On these pages are my WordPress plugins, the odd article and my Support Forum.

For my random rantings on everything else please visit my blog at Yellow Swordfish

WP Plugins


Articles

If you find any of my plugins useful, please comsider a donation towards my running costs.

Thank you

Current User: Guest
Please consider registering

 
Search Forums:


 




replacement for get_page_category()?

UserPost

3:43 am
29 Oct 2007


Ardenstone

Guest

 
1

I’ve been using and enjoying the previous version, but upgraded to 2.3 and switched to the new one.  It looks great, but I was making use of the template function ‘get_page_category()’.  Is there something similar for this version, or is there another way to do it?  When the user lands on a page, I pull back the current category and then use that to see what pages are associated with it.  Do you know how to do this in the new version?

Hope you are well and thanks very much!

11:03 am
29 Oct 2007


Yellow Swordfish

Admin

Peterborough, England

posts 4481

 
2

You should be able to use the standard WP template tags with PCP instead and achieve the same things.

7:45 pm
31 Oct 2007


Ardenstone

Guest

 
3

Excellent, thanks for the feedback.  In case anyone else has the same issue, the code can be found at:

http://codex.wordpress.org/Template_Tags/get_the_category

If you know the pages will only have one category, you can just use:

$cat = get_the_category(); $cat = $cat[0]; echo $cat->cat_ID;
 

Thanks again! 

 

9:21 pm
31 Oct 2007


Yellow Swordfish

Admin

Peterborough, England

posts 4481

 
4

I am sorry my answer was a bit short the other day. I was just on my way out… but I should have looked it up for you.

So thanks for posting back here wth the details 



Reply to Topic: replacement for get_page_category()?

NOTE: New Posts are subject to administrator approval before being displayed

Guest Name (Required):

Guest EMail (Required):

Guest URL (required)

Math Required!
What is the sum of: 5 + 7        (Required)

Topic Reply:


 
 

About the Stuff at Yellow Swordfish forum

Currently Online:

Yellow Swordfish

8 Guests

Maximum Online: 71

Forums:

Groups: 3

Forums: 15

Topics: 1703

Posts: 11495

Members:

There are 780 members

There are 729 guests


Yellow Swordfish has made 4481 posts

Top Posters:

Mr Papa - 1167

-Radio- - 475

ovizii - 84

jfv - 80

angelic007 - 66

Administrator: Yellow Swordfish | Moderators: Yellow Swordfish, Mr Papa, -Radio-


© Simple:Press Forum - Version 3.1.3 (Build 356)