Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #341782

    http://kc.bydecosta.com/news/

    I have setup the page to display the Posts in “Masonry” style.
    Not sure if this is possible but the client wants to display the Title of each category on the Post Description.

    The Category should appear first above the Excerpt.

    Hope to hear from someone soon.

    Thanks,
    MP

    #341990

    Hi Marcelo!

    Thank you for using Enfold.

    You can edit config-templatebuilder > avia-shortcodes > masonry_entries.php. Use the get_the_category function. Please refer to the wordpress codex.

    Regards,
    Ismael

    #341997

    Great thanks but can you please let me know where on “masonry_entries.php” I would add the code. Is it possible for you to help?

    Thanks,
    MP

    #342288

    Hello Support,

    On “masonry_entries.php” I need to add the Category to be displayed below:
    $items .= “<h3 class=’av-masonry-entry-title entry-title’ {$markup}>{$the_title}</h3>”;

    What is the code that I need to add to display the category of the post.

    Hope you or any of your support team can help.

    Thanks,
    MP

    #343024

    Hi!

    Look for this code:

    if(strpos($this->atts['caption_elements'], 'excerpt') !== false && !empty($content)){
                            $markup = avia_markup_helper(array('context' => 'entry_content','echo'=>false, 'id'=>$entry['ID'], 'custom_markup'=>$this->atts['custom_markup']));
    						$items .=	"<div class='av-masonry-entry-content entry-content' {$markup}>{$content}</div>";	
    					}

    Replace it with:

    if(strpos($this->atts['caption_elements'], 'excerpt') !== false && !empty($content)){
                            $markup = avia_markup_helper(array('context' => 'entry_content','echo'=>false, 'id'=>$entry['ID'], 'custom_markup'=>$this->atts['custom_markup']));
    						$category = get_the_category($entry['ID']);						
    						$items .= "<div class='av-masonry-entry-content-category'>{$category[0]->name}</div>";					
    						$items .=	"<div class='av-masonry-entry-content entry-content' {$markup}>{$content}</div>";	
    					}

    For further modifications, please visit Envato Studio or Werkpress.

    Cheers!
    Ismael

    #343123

    Thank you so much. Code you provided worked like a charm.

    MP

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Displaying "Category Title" on Post Description’ is closed to new replies.