WordPress.org

Ready to get started?Download WordPress

Forums

Is it possible to put post title inside header image? (4 posts)

  1. brownkidd
    Member
    Posted 4 years ago #

    I'd like the titles of my featured posts to show up inside the header image with the summary and "READ MORE" link in the bottom of the header image. Similar to the posts on DannyChoo.com.

    But I only want posts in the "FEATURED" category to look like this. All the others must stay the same. Is this possible?

  2. kz
    Member
    Posted 4 years ago #

    query_posts('ports_per_page=1&category_name=FEATURED');
      if(have_posts()) :
        the_post();
        the_content('READ MORE');
      endif;
    wp_reset_query();

    See Customizing the Read More

  3. brownkidd
    Member
    Posted 4 years ago #

    Thanks so much! Where would I put this code? Would it go in the loop or as a style. Sorry, I'm really terrible at this stuff.

  4. brownkidd
    Member
    Posted 4 years ago #

    Okay, so I have something sort of like this in my loop:

    <?php query_posts('ports_per_page=1&category_name=FEATURED'); if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <div class="post" id="post-<?php the_ID(); ?>">
    <div class="lead-image-wrapper">
    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    <?php $image = get_post_meta($post->ID, "lead_image", true); ?>
    <img src="<?php echo $image; ?>" />
    </div>
    <div class="entry">
    <?php the_content('READ MORE'); ?>
    </div>
    <p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', ', ' | '); ?> <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></p>
    </div>
    <?php endwhile; ?>

    Not sure if it works yet and I highly doubt it will. Anybody see anything that maybe I'm missing so I can add it before I test it out?

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic