Forums

Need help with if is page and sticky post WP_Query (2 posts)

  1. geezerd
    Member
    Posted 1 year ago #

    I'm currently using this to display a sticky post in the header:

    <?php
    $stickies=get_option('sticky_posts') ;
    if ($stickies) {
       $args = array(
          'posts_per_page' => 1,
          'post__in'  => $stickies,
          'caller_get_posts' => 1
       );
       $featuredPosts = new WP_Query();
       $featuredPosts->query($args);
       while ($featuredPosts->have_posts()) : $featuredPosts->the_post(); ?>
          <div class="top-sticky" id="post-<?php the_ID(); ?>">
             <h1><?php the_title(); ?></h1>
             <div class="entry"><?php the_content('More...'); ?></div>
    <small><?php edit_post_link('Edit', '', ''); ?></small>
          </div>
       <?php endwhile;
    }; ?>

    I need to have some different text on a particular page, not the sticky post.

    What's a felluh to do? Thanks!

  2. geezerd
    Member
    Posted 1 year ago #

    Can anyone help me on this?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.