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:


 




Function not displaying category contents

UserPost

8:55 pm
2 Apr 2008


Brian C

Guest

 
1

I've installed the plug-in and assigned my pages to the “Case Studies” category. Here is the code I dropped into my sidebar:

<?php pcp_list_pages_by_category( 'Case Studies' , 'All' , false , true , '' , '' , false , '' ); ?>


This returns nothing except for the unordered list open and close tags.


However, if I remove 'Case Studies' and replace it with 'All' it displays all of my pages. So it seems like the pages aren't being assigned to the categories properly, or the template tag isn't calling them right.


I'm either missing something or there is an issue with this plug-in on Wordpress version 2.5.


Any thoughts?

9:17 pm
2 Apr 2008


Yellow Swordfish

Admin

Peterborough, England

posts 5004

 
2

Well, my sidebar (visible from all pages other than this forum) uses the plugin for my pages. The plugin lists are generated using it. I just also double checked and created a new page and it appeared in the category list just as it should.


Which means I tend towards the notion that you are missing something! But I'm not sure what. The formation of the function call is fine. The ONLY thng that leaves is the actual category record. It might sound like an insulting question, but are you 100% sure the actual category record reads 'Case Studies'? Remember it is case sensitive…?


There are two ways to check of the category is being assigned by the way. You can use the admin page that came with the plugin or - for a higher level of confort, edit one of the pages. The category should show as checked in the list.

10:59 pm
2 Apr 2008


Brian C

Guest

 
3

Haha, yes I've spelled everything correctly and verified category assignment in the edit view and page category admin.


I did just notice that on the page category admin, next to the page title it says “(Orphaned from Parent)”. The case studies pages are assigned to a parent page, “Case Studies” and when I remove this setting, everything seems to work. Is there a way to make this work on sub-pages or am I stuck leaving them unassigned?


Thanks a lot for your help and amazingly speedy response.

11:06 pm
2 Apr 2008


Brian C

Guest

 
4

Ok I see now that I have to have the parent page assigned to that category as well, then they both show up. However I just want the sub-pages, not the parent page.


Is this possible?

11:10 pm
2 Apr 2008


Yellow Swordfish

Admin

Peterborough, England

posts 5004

 
5

'Orphaned from parent' means the page is a sub-page with a parent entry but the parent no longer exists… - or at least, the ID of the parent in the sub-page record does not exist.

That makes a heirarchical display somewhat difficult.

Is it possible your sub-pages have become unlinked in some way?

PCP currently functions correctly for a single sub-page nesting but I have abug report in if the nesting is deeper than 1 (i.e., sub-sub-pages).

Does this help?

11:16 pm
2 Apr 2008


Yellow Swordfish

Admin

Peterborough, England

posts 5004

 
6

Brian C said:

Ok I see now that I have to have the parent page assigned to that category as well, then they both show up. However I just want the sub-pages, not the parent page.


Is this possible?


Yes - that's a better example. The page parent exists but is in a different 'category tree'. Also makes hierachical display a problem.

As to ONLY showing sub-pages… I think that is one option I haven't catered for.

1:12 am
3 Apr 2008


Brian C

Guest

 
7

Ok that answers my question. Do you have any plans on assigning classes or ids to the list components in the future? This would make it easy to stylize or in my case hide/show specific elements using CSS.


Thanks a lot for all your help and letting me use your code!

8:28 am
3 Apr 2008


Yellow Swordfish

Admin

Peterborough, England

posts 5004

 
8

It is somewhat remiss of me not to have done so isn't it? I'll try and find time today to do that. Anythugn special you'd like to see on the class front?

3:29 pm
3 Apr 2008


Brian C

Guest

 
9

Well I'm not a PHP guy, but I did a little tinkering and I am now able to pass a class name to the ul tag from the template tag. Then I changed line 473 to include the page number as an id in the li tag - if($display_as_list) echo(”<li id=\”page_”.$page['ID'].”\”>”);


That's all I really needed personally. May be good for others too?

4:18 pm
3 Apr 2008


Yellow Swordfish

Admin

Peterborough, England

posts 5004

 
10

Sounds good. Are you willing to send the code file? if so I;ll send you an email address… Lazy I know bit it all helps!

4:44 pm
3 Apr 2008


Brian C

Guest

 
11

No problem at all. I'm making a few other minor changes then I'll send you the final. Just shoot me an email at the address I gave the forum.

5:20 pm
3 Apr 2008


Yellow Swordfish

Admin

Peterborough, England

posts 5004

 
12

Thanks. Email on it's way.



Reply to Topic: Function not displaying category contents

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: 11 + 7        (Required)

Topic Reply:


 
 

About the Stuff at Yellow Swordfish forum

Currently Online:

23 Guests

Maximum Online: 71

Forums:

Groups: 3

Forums: 16

Topics: 1936

Posts: 13127

Members:

There are 914 members

There are 793 guests


Yellow Swordfish has made 5004 posts

Top Posters:

Mr Papa - 1430

-Radio- - 518

ovizii - 106

jfv - 82

RoseCitySister - 68

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


© Simple:Press Forum - Version 3.1.4 (Build 357)