-
AuthorPosts
-
May 25, 2015 at 12:57 pm #449478
Hi,
On a portfolio entry page, the tags are displayed at the bottom of the page.
I would like to add the exact same functionality on the pages and posts: http://d.pr/i/1bpGU/3AMc2hju and I would like to have the exact same feature on Pages and Posts.
I have installed the following plugin: https://wordpress.org/plugins/category-tag-pages/ and I can see my tags now on the back-end, however, I have very limited knowledge on how to add the code in Enfold files to display them.
Any tips please?
Thank you all.
May 25, 2015 at 6:23 pm #449655Hi sitesme!
By default you cannot add tags to pages. Your pages do not display in the WordPress queries, loops, post lists, etc, so there is not really a point in adding tags to them. If the plugin your using is not working then I would try contacting the plugin author for help or looking for another plugin.
Cheers!
ElliottMay 25, 2015 at 6:28 pm #449659Hi Elliott,
What I would like to know is how can I find the code that is displaying tags at the bottom of a portfolio item? Check here for an example (at the bottom): http://d.pr/1kovT/4fOXwK9a
If I simply copy/paste the same code to the “Pages” template it should work, right?
Thank you for your help.
May 26, 2015 at 11:48 am #450005Hey!
Check includes/loop-portfolio-single.php, line 40-48:
if(has_tag() && is_single()) { echo '<span class="blog-tags minor-meta">'; the_tags('<strong>'.__('Tags:','avia_framework').'</strong><span> '); echo '</span></span>'; } echo '</footer>';
Reference:
https://codex.wordpress.org/Function_Reference/has_tag
https://codex.wordpress.org/Function_Reference/is_single
https://codex.wordpress.org/Function_Reference/the_tagsRegards,
JosueJune 7, 2015 at 1:29 pm #455626Hi,
I am not sure why but if I leave the WP default editor on, I can see my Portfolio pages with the tags at the bottom of the page.
However, if I turn on the Enfold editor the same tags disappear. If I toggle the WP editor or Enfold editor it basically displays or hides the tags at the bottom of the page.Any idea?
June 7, 2015 at 10:36 pm #455671This reply has been marked as private.June 8, 2015 at 12:11 am #455678Hey!
That’s currently the expected behavior, when you activate ALB it will convert that post type into a empty canvas so all its native features will be lost. Try the following:
https://kriesi.at/support/topic/show-tags-under-blog-posts/Cheers!
JosueJune 8, 2015 at 12:37 am #455680Hi Josue,
This didn’t work for me: https://kriesi.at/support/topic/show-tags-under-blog-posts/
I installed the plugin, created the simple shortcode http://d.pr/i/CrJ1/lQ2FTeR3 with PHP: http://d.pr/i/14o6C/IAX6lIKl
Added the shortcode in a text block: http://d.pr/i/13G7G/5XfF2n0e but I can’t find any tags there: http://d.pr/1eyEg/3Uzqte21Any idea?
Thank you
June 8, 2015 at 12:46 am #455681Hey!
Try using
the_terms
instead of thethe_tags
:
http://codex.wordpress.org/Function_Reference/the_termsRegards,
JosueJune 8, 2015 at 12:49 am #455683Still no luck :(
FYI, this is for the portfolio pages. The example on the other post is for the posts.
Please confirm if this can be the issue?June 8, 2015 at 12:57 am #455685This reply has been marked as private.June 8, 2015 at 3:12 am #455691the_tags( 'Tags: ', ', ', '<br />' );
It’s the correct code but seems the plugin is not working as expected, i tried directly adding it to template-builder.php (this file is the one used when ALB is enabled) and it worked.
Now that we know the problem is not the in the code i’d suggest generating the Shortcode the ‘old way‘ to avoid editing template-builder.php.
Regards,
JosueJune 8, 2015 at 9:58 am #455850Thank you Josue,
However, what is the solution to avoid using the template-builder.php?
I would prefer to add a “code block” at the bottom of each page that requires tags. Something like:
[mytagshere]
Is this possible? I don’t mind to have a code in the functions.php file if required for this (since we have this file in the child theme already).Thank you
June 8, 2015 at 10:14 am #455876Hi!
Try adding this to your child theme functions.php:
function my_tags_shortcode() { return get_the_tags( 'Tags: ', ', ', '<br />' ); } add_shortcode( 'mytagshere', 'my_tags_shortcode' );
Remove the shortcode you created in Shortcodes UI first.
Regards,
JosueJune 8, 2015 at 10:19 am #455884Hi Josue,
Thank you for your efforts but the change above didn’t show any tags as yet.
I tried [mytagshere] in a text block and in a code block.June 8, 2015 at 10:22 am #455888Access provided here is no longer working.
Regards,
JosueJune 8, 2015 at 10:23 am #455890Please check now Josue
June 8, 2015 at 10:31 am #455904Done, here’s the final code:
function my_tags_shortcode() { ob_start(); the_tags( 'Tags: ', ', ', '<br />' ); return ob_get_clean(); } add_shortcode( 'mytagshere', 'my_tags_shortcode' );
Best regards,
JosueJune 8, 2015 at 10:35 am #455912Superb, thank you Josue! :)
June 8, 2015 at 10:38 am #455920You are welcome, glad to help :)
Regards,
Josue -
AuthorPosts
- You must be logged in to reply to this topic.