WordPress.org

Ready to get started?Download WordPress

Forums

archive.php mod to show full post content only with posts tagged "the list" (3 posts)

  1. danapalooza
    Member
    Posted 2 years ago #

    This is for http://danielmarkham.com

    I know little about the inner-workings of PHP (as will become apparent momentarily) but here's what I want to do…

    Using the archive.php page, I would like the tag archive page for the tag the list (slug: the-list) to be the only archive page of any kind to display the full post content in the results.

    Currently, I have eliminated the template tag

    <?php the_content('[Read more →]'); ?>

    between

    <?php while (have_posts()) : the_post(); ?>

    and

    <?php endwhile; ?>

    so that the list of any archive is neat and clean, necessitating one to click the title of the post in the list to get to a post's permalink page.

    Here's the code for my current archive.php page…

    [code moderated per forum rules - please use the pastebin for any code above the forum limit of 10 lines]

    …and here is the last messed up code I tried for archive.php,in order to get it to do what I wanted…

    [code moderated per forum rules - please use the pastebin for any code above the forum limit of 10 lines]

    It didn't work. Any help would be greatly appreciated.

  2. danapalooza
    Member
    Posted 2 years ago #

    Per WordPress.org's code rules, here is the code for my current archive.php file… http://cl.ly/F6Xi

    Here is the code for the modified archive.php file, which is not working… http://cl.ly/F5fI

    Any help would be appreciated.

  3. alchymyth
    Forum Moderator
    Posted 2 years ago #

    a: you have the same code in the if and elseif section
    b: you are not allowing any output for any other than tag archives

    I would like the tag archive page for the tag the list (slug: the-list) to be the only archive page of any kind to display the full post content in the results.

    try to only add this line into the original archive.php where you want the content to show:
    (i.e. between these lines:

    </p>
    
    	</div><!-- end post -->

    )

    <?php /* Show full post content is posts are tagged with "the list" */ if (is_tag( 'the-list' )) { the_content(); } ?>

    total archive.php http://pastebin.com/K3w4uL9J

Topic Closed

This topic has been closed to new replies.

About this Topic