• Hey,

    Does anyone know how I can make the categories of my blog show the full page when you view it in the archives.

    So when you view an archives date, a tag, or even do a search the results always come back with the blog title, no image, and the first paragraph with this on the end: […]

    But when you click on a category on my blog, I want it to display the whole post including an image and the full paragraph.

    I’ve seen this somewhere before but I can’t remember, so I’m pretty sure it is possible.

    Any help is appreciated.

    Thanks.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Depending on your theme, it is probably controlled in the archive.php file. Find the_excerpt() and replace with the_content().

    Thread Starter danaldinho

    (@danaldinho)

    I just edited:

    <p><?php if ( is_category($vidcat) ) { the_content(); } else { echo strip_tags(get_the_content(), '<a><strong>'); } ?></p>

    But it didn’t work how I wanted it.

    It didn’t display the images and add the space between each paragraph.

    Can you post a link to a page that shows the problem? What was the code before you edited it?

    The code you showed will only display the full content for the category specified in $vidcat. If what you want is the full content for all categories, you can change it to this:

    <p><?php the_content(); ?></p>

    Thread Starter danaldinho

    (@danaldinho)

    In archive.php, I had this:

    <p><?php if ( is_category($vidcat) ) { the_content(); } else { echo strip_tags(get_the_excerpt(), '<a><strong>'); } ?></p>

    I edited it to be:

    <p><?php if ( is_category($vidcat) ) { the_content(); } else { echo strip_tags(get_the_content(), '<a><strong>'); } ?></p>

    And here is a category page: https://www.lilwaynehq.com/category/audio/

    Looks like you need to try just <p><?php the_content(); ?></p>.

    Moderator keesiemeijer

    (@keesiemeijer)

    echo strip_tags(get_the_content(), '<a><strong>');
    Will strip images from the (full) content.
    Why don’t you use:

    <p><?php if (is_category()) { the_content(); } else { echo strip_tags(get_the_content(), '<a><strong>'); } ?></p>

    Now you have full posts with pictures on category pages and on other pages you will have full posts without pictures.

    But from what I can see u make use of the_excerpt(); somewhere because you have those […] thingies on your category page.

    I think the original code had get_the_excerpt();

    <p><?php if ( is_category($vidcat) ) { the_content(); } else { echo strip_tags(get_the_excerpt(), '<a><strong>'); } ?></p>

    Moderator keesiemeijer

    (@keesiemeijer)

    Yeah but that is changed and the category page still uses the excerpt somewhere because of the “[…]”.

    echo strip_tags(get_the_content(), '<a><strong>');
    This will give you a full post without images and no “[…]”.

    So I suggest to just use:
    <p><?php the_content(); ?></p>
    And see if anything changes.

    And also check with in_category() in stead of is_category()

    Thread Starter danaldinho

    (@danaldinho)

    Thanks both of you, it worked.

    Appreciate it so much!

    Glad you got it working! Now, please use the dropdown at top right to mark this topic ‘Resolved’.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Categories show full posts’ is closed to new replies.