Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1321646

    Hi,

    I would like to display the categorry-titles of each post below the titles and above the extract in de blog grid items.

    How can I accomplish that? On blog page as well as on archive/category pages

    I am using child theme

    see links in private content

    #1321872

    Hey Alexander,

    Thank you for the inquiry.

    Try adding this filter in the functions.php file to render the category title above the excerpt and below the title.

    add_filter("avf_post_slider_entry_excerpt", function($excerpt, $prepare_excerpt, $permalink, $entry) {
    	if(is_archive()) {
    		$excerpt = '<span class="slide-archive-title"></span>' . get_the_archive_title() . '</span>' . $excerpt;
    	}
    
    	return $excerpt;
    }, 10, 4);
    

    Best regards,
    Ismael

    #1321912

    Hi Ismael,

    I added your code but nothing happens.

    What else can we try?

    Regards, Alexander

    #1322114

    Hi,

    Thank you for the update.

    Do you see any errors after adding the code? Please post the login details in the private field so that we can check the modifications. Make sure that the Appearance > Editor panel is accessible so that we can edit the files directly from the dashboard.

    Best regards,
    Ismael

    #1322163

    Hi Ismael,

    I provided a temporary login for you, see private content

    #1322181

    Hi,

    Thank you for the info.

    The filter is working as it should. It displays the category title between the excerpt and the post title. Please check the category page below. (see private field)

    Best regards,
    Ismael

    #1322185

    Hi Ismael,

    I am not using the category pages. I am trying to show it on pages with blog element. see example links in private.

    Best regards, Alexander

    #1322198

    Hi,

    Thank you for the clarification.

    We adjusted the filter in the functions.php file a bit and used the get_the_term_list function. You will now see a list of categories below the title. (see private field)

    /*add category titles*/
    add_filter("avf_post_slider_entry_excerpt", function($excerpt, $prepare_excerpt, $permalink, $entry) {	
    	$excerpt = get_the_term_list($entry->ID, "category", '', ', ') . "<br>" . $excerpt;
    	return $excerpt;
    }, 10, 4);
    
    

    Best regards,
    Ismael

    #1322220

    Hi Ismael,

    Thanks for that, it worked.

    Is it possible to make my category pages look like the (manually constructed) example in private section.
    With a header image, the categories displayed in a button row, and active category highlighted?

    Regards, Alexander

    #1322408

    Hi,

    No problem. Unfortunately, you cannot use the advance layout builder (ALB) to adjust the layout of the archive pages. You will have to manually edit the archives.php template for that. Another solution is to create a custom category page using the ALB, then do a 301 redirect to display the custom page instead of the default archive page. The following plugin should help.

    // https://wordpress.org/plugins/eps-301-redirects/

    If you have any additional questions at this time we kindly ask that you open them up in a separate thread. The longer threads get in the forum, they become more difficult to support as they tend to drift off topic and they also make it troublesome for users trying to search for solutions. Keeping threads relevant to their original inquiry ensures that we can keep better track of what has been resolved and that users can more effectively find answers to similar issues they might be experiencing.

    Thanks!

    Best regards,
    Ismael

    #1322775

    Hi Ismael,

    Thanks, works like a charm :-)

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘show categories in blog grid’ is closed to new replies.