• Resolved dheerg

    (@dheerg)


    Hello,

    I am trying to figure out a way to insert some text into a post through the loop if the post has been assigned a specific tag. This is for the main index and single page (index.php) and not a tag/archive/category page.
    The basic structure of what I have in mind is as follows:

    <?php if(have_posts()) : ?>
    <?php while(have_posts()) : the_post(); ?>
    <div class="post-meta" id="post-<?php the_ID(); ?>">
    <div class="post-content">
    
    <strong><?php if (is_tag('11') ): ?>
    Its alive...
    <?php endif; ?></strong>
    <?php the_content("Continue reading &rarr;"); ?>
    </div>

    What I need to understand is how can I make this work as the_tag() surely does not get the work done.

    Any help would be appreciated.

    Regards,

    dheerg

Viewing 1 replies (of 1 total)
  • Thread Starter dheerg

    (@dheerg)

    I took the more complicated way for myself (i have to assign new categories to a sh*t load of post) and decided to go with in_category() to get the task done.

    Regards,
    Dheer

Viewing 1 replies (of 1 total)
  • The topic ‘Styling post according if it contains a tag’ is closed to new replies.