Plugin Articole recente in Single.php

Mariuselll

Moderator
Membru personal
Moderator
VIP Club
Salutare. Stiti ceva plugin care sa arate in single.php (postari) ultimele articole adaugate , daca se poate sa se si seteze sa apara ultimele articole din ultimile 24 ore.

Ps: Nu plugin care sa arate in widget.
 
Iti pot face un mic script daca vrei si nu mai trebuie sa instalezi niciun plugin
 
Am mai postat eu ceva de genul pe forum.
Uite codul care il adaugi unde vrei tu sa apara in pagina. Modifici 5 cu numarul dorit de tine.

Cod:
<ul>
// Define our WP Query Parameters
<?php $the_query = new WP_Query( 'posts_per_page=5' ); ?>
 
// Start our WP Query
<?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>
 
// Display the Post Title with Hyperlink
<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
 
// Display the Post Excerpt
<li><?php the_excerpt(__('(more…)')); ?></li>
 
// Repeat the process and reset once it hits the limit
<?php
endwhile;
wp_reset_postdata();
?>
</ul>
 
Am mai postat eu ceva de genul pe forum.
Uite codul care il adaugi unde vrei tu sa apara in pagina. Modifici 5 cu numarul dorit de tine.

Cod:
<ul>
// Define our WP Query Parameters
<?php $the_query = new WP_Query( 'posts_per_page=5' ); ?>

// Start our WP Query
<?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>

// Display the Post Title with Hyperlink
<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>

// Display the Post Excerpt
<li><?php the_excerpt(__('(more…)')); ?></li>

// Repeat the process and reset once it hits the limit
<?php
endwhile;
wp_reset_postdata();
?>
</ul>
E bine si asa . Am modificat eu un pic ca nu dadea bine. Multumesc

Cod:
<ul>
<?php $the_query = new WP_Query( 'posts_per_page=20' ); ?>

        <center>    <h3>TITLU</h3> </center>
        <?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>

        <center><li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li></center>
<?php
endwhile;
wp_reset_postdata();
?>
</ul>
 
Loading...
Back
Sus