WordPress.org

Ready to get started?Download WordPress

Forums

Remove "Read More" Based On Category (2 posts)

  1. PerkUpVegas
    Member
    Posted 2 years ago #

    Hello WP gurus! I am trying to eliminate the "Read More" tag from posts for my store page that are assigned to the "store" category. I would like the post to display the entire contents...which will show the add to cart button for each product.

    I have seen reference to excerpt() before, but am not having luck implementing it.

    Do you have recommendations on implementation or suggestions for a particular plugin that can help me do this?

    Thank you!
    -John

    http://perkuplv.com/category/store/

  2. Marventus
    Member
    Posted 2 years ago #

    Hi John,
    If what you would like to accomplish is to display the entire length of the post for your store category only and the summary (with the Read More link) for your other posts and content, you would need to use the_content() instead of the_excerpt() to accomplish that.
    Basically, open up your archive.php or category.php file, look for the_excerpt(), and use a Conditional Tags (PHP if statement) to test which category you are on. Smth like:

    if ( is_category('store') {
        the_content();
    } else {
        the_excerpt();
    }

    Cheers!

Topic Closed

This topic has been closed to new replies.

About this Topic