• Resolved Damyan90

    (@damyan90)


    Hey guys,

    Is it possible to show full text instead of the excerpt in a category page?
    I am trying to do it with css.

    Thanks,
    Damyan

Viewing 10 replies - 1 through 10 (of 10 total)
  • Theme Author Archimidis Mertzanos

    (@archimidism)

    Hello dear @damyan90 the first thing you have to do is to create a child theme.
    From the parent theme you have to copy the exact file structure.

    “template-parts/content/category/category-style-1.php”.
    Open the file category-style-1.php and find the line 13:

    <?php the_excerpt(); ?> and change it with
    <?php the_content(); ?>
    You are done!

    Thread Starter Damyan90

    (@damyan90)

    Hello again,

    Thank you for the response!
    But this solution will change the excerpts of all posts. And I need it only for a specific category.

    Do you have an idea about this?

    Thanks,
    Damyan

    Theme Author Archimidis Mertzanos

    (@archimidism)

    Dear @damyan90 ofcourse we have a clue.
    Please tell us the specific category and its slug.
    Is is a plain post category or a custom taxonoy term?

    Thread Starter Damyan90

    (@damyan90)

    Hello again,

    I haven’t created the category yet, but I will. It will be named “vicove” and it will stay under https://haha.bg/vicove/

    I found a way to remove …/category/… from the url.

    I hope this helps.

    Theme Author Archimidis Mertzanos

    (@archimidism)

    No you don’t have to remove the category slug. You can wrap the following code like this:

    if(is_category('vicove')): 
    the_content();
    else:
    the_excerpt();
    endif;
    

    and you will notice that it will work.

    Thread Starter Damyan90

    (@damyan90)

    Hello again,

    Thanks, will test now.
    But I do want to remove /category/ from the link. Will this prevent the function from working?

    Theme Author Archimidis Mertzanos

    (@archimidism)

    Hm I don’t think so because is_category is a WordPress built in method which looks at the category archive page.
    Try this and please tell me
    the result.

    Thread Starter Damyan90

    (@damyan90)

    So, my bad about something.

    The name of the category is “тестова”
    The slug is “testova”
    The url is: https://haha.bg/blog/category/testova/

    This is a test category where I am trying to see if it will work. So, here is what I am doing:

    https://ibb.co/mLT659

    And here it is what I am getting:

    https://ibb.co/ht7NdU

    See that the excerpt is totally disappearing.

    Theme Author Archimidis Mertzanos

    (@archimidism)

    You haven’t wrap the code in the php tags.

    <?php if…. ?>

    Thread Starter Damyan90

    (@damyan90)

    Worked like a charm. Thank you!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Custom Excerpt in Category’ is closed to new replies.