![]() | | ||||||||
| | #1 |
| Bruce Hopkins War Room Member Join Date: Mar 2006 Location: Atlanta, Georgia, USA.
Posts: 1,121
Thanks: 12
Thanked 74 Times in 31 Posts
|
I'm running into a little issue I was hoping some of you Wordpress developer gurus could give me a clue about. I need to get the tags in a post form a call in the sidebar and I can't seem to make it work. Now I am by no means a PHP guru so I'm probably doing this all wrong. First I tried to just call <?php the_tags('') ?> which works fine from within the loop, but not when called from the sidebar. Then I tried <?php get_tags('') ?> and <?php get_the_tags ?> And finally <?php $post->get_the_tags('') ?> Which pretty much keeps screwing up the site and causing it not to load. I can't believe this is eluding me as it seems like it should be simple. All the examples I've found of using get_the_tags so using a function and returning a list with the links of the tags too. Since I don't really know php all that well yet( I'm learning), then I'm not sure how to translate the examples I've found to usable for me, plus I can't believe there is not just function I can call to get this text easily. tia Bruce |
| | |
| | |
| | #3 |
| I'm Kind Of A Big Deal Join Date: Sep 2009
Posts: 2,003
Thanks: 60
Thanked 448 Times in 321 Posts
|
did you want all of your sites tags in the sidebar? then cage73 (up above) has given you the answer. learn more here |
| | |
| | |
| | #4 |
| Bruce Hopkins War Room Member Join Date: Mar 2006 Location: Atlanta, Georgia, USA.
Posts: 1,121
Thanks: 12
Thanked 74 Times in 31 Posts
|
I don't want all the tags from the site. Just the ones that are in the current post that is displayed. So I need to pull the tags from the current post from single.php.
|
| | |
| | |
| | #5 |
| WordPress Cognoscente War Room Member Join Date: Oct 2007 Location: Cheltenham , United Kingdom.
Posts: 478
Blog Entries: 1 Thanks: 55
Thanked 244 Times in 82 Posts
|
Not sure if this will work: Display Different Sidebar for Each Post and Page for WordPress (there's also a plugin that will display sidebar widgets depending on post id but can't remember what it is) |
| | |
| | |
| | #6 |
| HyperActive Warrior Join Date: May 2005 Location: , , United Kingdom.
Posts: 372
Thanks: 0
Thanked 15 Times in 15 Posts
|
I had the same issue and I just used the info in the last post here and it worked for me, Thanks again
|
|
All My Secret Strategies Exposed - http://www.OneMillionIncome.com View My Blog For $1000 + FREE Info - http://www.MarkMcCulloch.info Decide Your Own Income - http://www.DecideYourIncome.eu | |
| | |
| | #7 |
| Bruce Hopkins War Room Member Join Date: Mar 2006 Location: Atlanta, Georgia, USA.
Posts: 1,121
Thanks: 12
Thanked 74 Times in 31 Posts
|
The main issue here is the sidebar is outside the loop. I found this article which gives a function that will make this work out great if anyone is interested. Tags Outside The Loop In WordPress | Knee Deep In Code Bruce |
| | |
| | |
![]() |
|
| Tags |
| gurus, plugin, wordpress |
| Thread Tools | |
| |
![]() |