-
AuthorPosts
-
November 28, 2013 at 7:10 pm #194466
Hi there,
I was just searching for ways to insert a post’s tags into an iconbox but seem to have no way around it. I’ve attempted to input shortcodes as an alternative with a suggestion using “Insert PHP” plugin, but it didn’t really work.
So I would like to ask if there is some way I can work around to get the tags displaying, with clickable links of it to like an auto-search page based on the tags?
Thanks!
Regards,
Robert ChaiNovember 28, 2013 at 11:04 pm #194520Hey sgrobert!
What ‘tags’ do you want to show? you could create a custom shortcode to embed them, try adding this to the functions.php file:
function custom_shortcode() { return get_the_tags(); } add_shortcode( 'my_custom_tags', 'custom_shortcode' );
Best regards,
JosueNovember 29, 2013 at 3:22 am #194582Hi Josue,
I’m enquiring to display the Portfolio-tags or Post-tags, to retrieve them for display when a portfolio item or post loads into view. Given this, is there a way to retrieve the tags through the advanced editor? As apparently any form of shortcode insertion seem to not work or break the theme, while inserting the code within the advanced editor instead of the default one?
I was hoping of using this method as going through the original code and editing it is really not the ideal way as I’ve paid for the theme in hopes to make my life simpler. Thanks.
Regards,
Robert ChaiNovember 29, 2013 at 3:58 am #194587Hey!
The tags you want to retrieve are the ones of the current Post/Portfolio?, the code i provided is meant to be put in the functions.php file, after that you can use [my_custom_tags] to invoke it.
Best regards,
JosueNovember 29, 2013 at 4:54 am #194598Hi Josue,
I’ve just tried your method, but apparently it displays an “Array” text. May I know how to break it part to show like “Tags: Shirts, Red” something like that?
Thanks.
Regards,
Robert ChaiNovember 29, 2013 at 5:25 am #194605Hey!
I will make some tests locally and keep you updated :)
Regards,
JosueNovember 29, 2013 at 5:57 am #194609Hi Josue,
Thanks! Looking forward to the updates.
Regards,
Robert ChaiNovember 29, 2013 at 11:31 am #194698Hey!
I think you just need to use another function – try following colde instead which uses the get_the_tag_list function: http://codex.wordpress.org/Function_Reference/get_the_tag_list
function custom_shortcode() { return get_the_tag_list('<p>Tags: ',', ','</p>'); } add_shortcode( 'my_custom_tags', 'custom_shortcode' );
Cheers!
PeterNovember 29, 2013 at 12:34 pm #194712This reply has been marked as private.December 2, 2013 at 9:44 am #195215Hi!
The syntax of the code I posted above seems to be valid for me but try to remove the p tag – maybe it’s not supported by the “Insert php” plugin:
function custom_shortcode() { return get_the_tag_list('Tags: ',', ',''); } add_shortcode( 'my_custom_tags', 'custom_shortcode' );
Best regards,
PeterDecember 2, 2013 at 6:18 pm #195390Hi Dude,
I actually went on to search another plugin called “Allow PHP in Posts” and it works smoothly for me instead. Thanks for helping! ;)
Regards,
Robert Chai -
AuthorPosts
- The topic ‘Displaying Tags in IconBox?’ is closed to new replies.