Home › Forums › WordPress › How to print shortcode title & category from shortcode in wordpress This topic has 1 reply, 2 voices, and was last updated 2 months ago by avi. Viewing 1 reply thread Author Posts October 3, 2024 at 11:46 am #142 avneeshParticipant I want to add title & and category in shortcode like this : [custom_post_title title="Athletes" category_id="17669"] I want to print the title of the shortcode How can i do that Can anyone help me?? October 3, 2024 at 11:48 am #143 aviParticipant Add this code in functions.php file : $atts = shortcode_atts( array( 'title' => null, 'category_id' => null ), $atts); and after that you can use the given code for print the value where you want : echo $atts['title']; Author Posts Viewing 1 reply thread You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In