I’m trying to write a custom version of the masonry_entries.php shortcode that adds the tags and categories of an entry to the title but I’m having trouble getting this information.
Could you point me the right direction to grab the categories and tags and write them out with the title?
Hi rgruber!
Thank you for using Enfold.
Please refer to these links on how to get the categories and tags of posts:
http://codex.wordpress.org/Function_Reference/get_the_tags
http://codex.wordpress.org/Function_Reference/get_the_category
If you’re going to modify the shortcodes, please use a child theme. Add this on functions.php:
add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1);
function avia_include_shortcode_template($paths)
{
$template_url = get_stylesheet_directory();
array_unshift($paths, $template_url.'/shortcodes/');
return $paths;
}
Create a folder called “shortcodes”. Add the masonry_entries.php there.
Best regards,
Ismael