In a PSD > WP project that I am currently working on, the requirement is to show category name linked to corresponding category archive page in a Genesis Featured Posts widget. Using the standard
post_categoriesshortcode displays names of all the linked categories that the post belongs to separated by commas. There could be times when you want to display just one category though, like this: We can copy the
add_shortcodefunction from genesis/lib/shortcodes/post.php where
Filed Under: Genesis, Premium Contentis defined and modify it for creating a custom
[post_category]shortcode that outputs the first category (link) by adding the following in child theme's functions.php:
To view the full content, please sign up for the membership.
Already a member? Log in below or here.