Plugin Author
ivycat
(@ivycat)
Posted with a different account but it’s not showing up. So Weird.
Copy and pasted below:
Hello C3dRy2K,
Try:
<?php
$tags = implode( ',', wp_list_pluck( get_the_tags(), 'slug' ) );
echo do_shortcode("[ic_add_posts category='test' tags='$tags']");
?>
or for better readability:
<?php
$array_of_tag_objects = get_the_tags();
$tag_array = wp_list_pluck( $array_of_tag_objects, 'slug' );
$tags = implode( ',', $tag_array );
echo do_shortcode("[ic_add_posts category='test' tags='$tags']");
?>
it doesn’t work. it shows only the posts from “test” category, the page tag is not taken.
perhaps it will work if change that tag with custom url, and i create that custom page url exactly like the tag that i want to appear. Sry, i’m not so good with php, that i ask for help in here.
C3dRy2K,
Yep, try changing “test” to whatever category you want to display with the shortcode.
Are you putting the shortcode in a page or a post? Pages, at least by default, do not have tags, so I’m not sure the get_the_tags() function would work. It might if you have a plugin that allows you to give pages tags, but I’m not certain.
Plugin Author
ivycat
(@ivycat)
C3dRy2K,
Yep, try changing “test” to whatever category you want to display with the shortcode.
Are you putting the shortcode in a page or a post? Pages, at least by default, do not have tags, so I’m not sure the get_the_tags() function would work. It might if you have a plugin that allows you to give pages tags, but I’m not certain.
Dont worry, i put the category that i hant to display. I put this code into pages. I use this plugin for page tags, Page Tagger.
Hey C3dRy2K,
So, you’ve solved this issue, correct?
No Eric, i didn’t solve it. I don’t know how
Hi C3dRy2k,
Not entirely sure what to tell you – sounds like you’re using a plugin to tag pages and that may be the issue.
Can you post the exact code you’re using now (or trying to use)?
Thanks,
Eric
I’m not using any php code, because nothing works. I don’t know what to do any more. I just want to display posts in page by tag page
For example i have “father” page, with tag “tag-father”. And couple of posts with that tag “tag-father” on multiple categoris. i want to display in page “father” posts from category 1 by tag “tag-father”, posts from category 2 by tag “tag-father” and so on.