Tagged: portfolio tags
-
AuthorPosts
-
August 25, 2018 at 2:18 pm #1001648
HI
I am trying to get my portfolio tags to automatically show on the bottom of all my portfolio items, made in the advanced editor. I followed this thread (https://kriesi.at/support/topic/portfolio-items-tags/#post-345704) which puts the tags at the top of the page, and although the link urls seem to be correct, none of the portfolio items show up on the linked pages.Can you see what’s wrong? This is the code I have in the functions.php of my child theme to show the portfolio tags:
add_filter('avf_template_builder_content', 'avia_add_social_toolbar_template_builder', 10, 1); function avia_add_social_toolbar_template_builder($content = "") { if(is_singular('portfolio')) { $content .= '<span class="blog-tags minor-meta">'; $content .= the_tags('<strong>'.__('Tags:','avia_framework').'</strong><span> '); $content .= '</span></span>'; } return $content; }
thanks for your help,
NancyAugust 25, 2018 at 6:13 pm #1001702Hey Munford,
Which version of php are you running?
Best regards,
VictoriaAugust 25, 2018 at 7:13 pm #1001738Hi Victoria
thanks for looking (again) at this issue. I started a new thread since I am using a different code now. I am running php 7.1.Nancy
- This reply was modified 6 years, 4 months ago by Munford.
August 25, 2018 at 7:55 pm #1001747Hi,
This is a bug of the local seo plugin (see https://kriesi.at/support/topic/tag-pages-posts-nothing-found/ ). I fixed it on your website too.
Best regards,
DudeAugust 25, 2018 at 8:37 pm #1001760Hi Dude,
Great! Thanks very much! That works fine.
Can anyone help me to move the tags to the bottom, or underneath, the trip info, instead of them displaying at the top?
thanks for your help
NancyAugust 25, 2018 at 9:42 pm #1001776Hi,
I replaced your code with this function to solve the issue:
add_filter('avf_template_builder_content', 'avia_add_social_toolbar_template_builder', 999, 1); function avia_add_social_toolbar_template_builder($content = "") { if(is_singular('portfolio')) { $posttags = get_the_tags(); if ($posttags) { $content .= '<span class="blog-tags minor-meta"><strong>'.__('Tags:','avia_framework').'</strong><span> '; $numItems = count($posttags); $i = 0; foreach($posttags as $key=>$tag) { if(++$i === $numItems) { $content .= '<a href="'.get_tag_link($tag->term_id).'">'. $tag->name .'</a>'; } else { $content .= '<a href="'.get_tag_link($tag->term_id).'">'. $tag->name .'</a>, '; } } $content .= '</span></span>'; } } return $content; }
Best regards,
DudeAugust 26, 2018 at 12:31 pm #1001852Hey Dude
your magic code worked! Have no idea what it’s about but thanks so much.
Working just great now – you can close this thread.you rock
NancyAugust 26, 2018 at 12:54 pm #1001859Hi,
Great, glad we could help you :)
Best regards,
Dude -
AuthorPosts
- The topic ‘Portfolio tags linking error, tag placement’ is closed to new replies.