Support » Fixing WordPress » get a single latest post.

Viewing 1 replies (of 1 total)
  • Use a WP_Query for each link.

    Something like:

    <?php
    $video_query_args = array( 'category_name' => 'videos', 'posts_per_page' => 1 );
    $video_query = new WP_Query( $video_query_args );
    
    if ( $video_query->have_posts() ) :
        while ( $video_query->have_posts() ) : $video_query->the_post();
    ?>
    <span class="homeblueTitle"><a href="<?php the_permalink(); ?>">video</a></span>
    <?php
        endwhile;
    endif;
    wp_reset_postdata();
    ?>

Viewing 1 replies (of 1 total)
  • The topic ‘get a single latest post.’ is closed to new replies.