User Instructions
Appreciate the plugin? Consider making a donation here.
Category Page Extender enables you to insert posts into various pages on you blog according to the corresponding categories. It includes page navigation if you wish to limit the number of posts per page.
Download Category Page Extender here
Category Page Extender is based on the relations set up using the Category Page plugin by pixline.
***YOU MUST HAVE THE CATEGORY PAGE PLUGIN INSTALLED IN ORDER FOR CATEGORY PAGE EXTENDER TO WORK.
Installation:
- First install category page by pixline
- Download the plugin Zip archive.
- Upload `Category Page Extender` folder to your `/wp-content/plugins/` directory
- Activate the plugin through the ‘Plugins’ menu in WordPress
- Setup some relationships between Categories and Pages using the Category Page plugin (see Category Page documentation here)
- Tweak `page.php` in your theme folder (see below).
- Enjoy!
Tweaking the ‘page.php’ file:
Open up page.php in your template folder (you may also set up a seperate a Page Template)
For the most basic setup, insert the following below the loop statement in the page.php file:
<?php if( function_exists(page2cat_pages)){
page2cat_pages(get_the_ID());
} ?>
I recommend you wrap the function in your standard post class. For example:
<div class="post">
<?php if( function_exists(page2cat_pages)){
page2cat_pages(get_the_ID());
} ?>
</div>
Plugin Options
<?php if( function_exists(page2cat_pages)){
page2cat_pages(get_the_ID(), posts per page, number of pages);
} ?>
Posts per page: (default = 10) set to 0 to show all
This sets the number of posts to show at one time on the page.
Number of pages: (default = 15) set to 0 to show all
This tells how many page numbers to show at a time on the page navigation bar.
Example of Category Page Extender with variables:
<?php if( function_exists(page2cat_pages)){
page2cat_pages(get_the_ID(), 5, 10);
} ?>
This will list 5 posts and up to 10 page numbers at a time on the page navigation bar.
<?php if( function_exists(page2cat_pages)){
page2cat_pages(get_the_ID(), 5, 0);
} ?>
This will list 5 posts and show all the page numbers available on the page navigation bar.
<?php if( function_exists(page2cat_pages)){
page2cat_pages(get_the_ID(), 0);
} ?>
This will list all posts associated with the category/page.
Customizing Post Display
Category Page Extender uses a generic code to display each post. You can customize it or copy and paste new code from your index.php file from the theme. You will find the code starting on line 76.
***Note that by default Category Page Extender only shows the excerpt of the post. To change this, replace:
<?php the_excerpt() ?>
on line 79 with:
<?php the_content() ?>
See code and highlight line below:
<?php
///////////////////////////////////////////////////////////////////////////
/// You can replace the code below to match your theme ///
/// (you can copy this from your archive.php, index.php or customize it ///
///////////////////////////////////////////////////////////////////////////
?>
<?php // ----- Start Code Replace ------ ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="post">
<h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
<div class="entry">
<?php the_excerpt() ?>
</div>
<div class="postmetadata"><?php edit_post_link('Edit', '', ' | '); ?> <?php the_time('d F Y') ?> | <?php the_author_posts_link('namefl'); ?> | <?php the_category(', ') ?> | <?php comments_popup_link('No Comment', '1 Comment', '% Comments'); ?> | <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>" class="more">Read More</a> <?php the_tags('<br /> Tags: ', ', ', ''); ?></div>
</div>
<?php endwhile; endif; ?>
<?php // ----- End Code Replace ------ ?>
<?php
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
?>
If you post code in the comments section, I recommend you wrap the code with wordpress’s sourcecode feature.
</code>
<code>Type your code here.</code>
<code> </code><code>
Otherwise your code may not show up when posted.
Permalink #
Paul O'Connor
said
Hi,
Thanks for the plugin.
Only thing is I can’t seem to get it to work. Maybe its because of the theme I’m using (Thesis 1.6) or maybe some of the code in my template I made is incorrect. I made a new template file for the page I want to display posts from ID=15 in. The code I placed in the template is:
ID=15, 20);} ?>
Is this correct?
Permalink #
Paul O'Connor
said
Sorry/ Forgot to use code quotes:
ID=15, 20);} ?>
Permalink #
GrpSmglr
said
I’m assuming when you say you want the ID=15 you’re talking about the category ID?
Have you installed the Category Page plugin from Pixline ( http://wordpress.org/extend/plugins/page2cat/ ) ? The plugin is necessary in order for Category Page Extender to work. After installing the plugin make sure to make the correct connections between the categories and corresponding pages.
You don’t enter the ID into the function parameters. You just use $post->ID. This pulls the current pages ID and then looks for the corresponding categoryID and list the posts on the page.
Assuming you want to show 20 posts per page, after you set up the category/page connections your code should look like this:
<?php if( function_exists(page2cat_pages)){ page2cat_pages($post->ID, 20);} ?>Permalink #
Paul O'Connor
said
Thank you for your reply. Its very appreciated. I’m still not able to make it work though.
I have installed Category Page and have made the connection between category 15 (Rinpoche’s News) and the News page. I did make the mistake of entering the ID code (15) in the formula before, but have now corrected it. Because the Thesis theme has no Page.php, I have created a template called ‘Page of Posts’ and placed your formula in it. I have then selected that template to be used in the page I created. The complete code in that template is as follows (if it shows up!):
<?php
/*
Template Name: Page Of Posts
*/
ID, 20);} ?>
Maybe you would take a look at the page in question? its at http://new.bodhicharya.org/?page_id=52
Thanks for all your help.
Paul
Permalink #
GrpSmglr
said
Hey Paul,
Your code didn’t show up…try wrapping it in wordpress sourcecode feature.
Read more about it here: http://en.support.wordpress.com/code/posting-source-code/
Permalink #
Chris
said
Hi, I installed the plug-in successfully. However, the same post appears three times on the page. I can’t seem to figure out why.
Check it out: http://www.yerevanreport.com/feature/
I’m using WordPress 2.8.6.
Please let me know what I’m doing wrong.
Thanks.
Permalink #
GrpSmglr
said
Chris…I didn’t see the problem on your page…did you fix it?
Permalink #
April
said
I, too, am getting double posts on my page. You can view what I mean at http://artdreamlife.com/short-stories/
I noticed, though, that the initial post (The Day the Music Died) is posted twice but the second post added (Blue Bird of Happiness) only appears once. These are only test posts as I am just setting up the site so you’ll be seeing a lot of lorem ipsum.
I used the default settings included in the plugins php code. The post display is set to “content” and I used the following option: “…($post->ID, 0);} ?> (without quotes of course!).
The blog theme is the Style 2 Christmas theme from InstantShift.
I really appreciate the time and effort you put into this. It will make organizing my site that much easier!
Take care,
April
Permalink #
GrpSmglr
said
did you alter the category page extender php file? For some reason it’s show the posts when it’s supposed to calculate the page numbers.
Can you wrap your sourcecode in wordpress’s sourcecode feature: read about it here: http://en.support.wordpress.com/code/posting-source-code/
Permalink #
April
said
Guess it helps if I actually place the code before The Loop. I think I’ve got it fixed!
thanks,
April
Permalink #
April Hayman
said
I have altered it according to your directions and I’m still not getting page numbers. What am I missing?
By the way, I’ve tried putting the code before and after the loop. Only putting it before the loop works otherwise I get a repeat of the first post.
Permalink #
GrpSmglr
said
you can also try switching out
$post->and replace it with:
get_the_ID()Permalink #
GrpSmglr
said
April…Your site still looks a bit messed up to me. When I look at your sourcecode it seems that the second copy of your stories are beeing wrapped in the comments div.
Can you post your all your code from your page.php file (or whatever page template file you use). Make sure to wrap it with the sourcecode feature. See red box above if you don’t know what I’m talking about.
Permalink #
April
said
Thanks for looking. Here is the source code from the page.php file:
<?php get_header() ?> <div id="container"> <div id="content"> <?php get_sidebar('page-top') ?> <?php the_post() ?> <div id="post-<?php the_ID(); ?>" class="<?php thematic_post_class() ?>"> <?php thematic_postheader(); ?> <div class="entry-content"> <?php the_content() ?> <?php wp_link_pages("\t\t\t\t\t<div class='page-link'>".__('Pages: ', 'thematic'), "</div>\n", 'number'); ?> <?php edit_post_link(__('Edit', 'thematic'),'<span class="edit-link">','</span>') ?> </div> </div><!-- .post --> <?php if ( get_post_custom_values('comments') ) thematic_comments_template() // Add a key+value of "comments" to enable comments on this page ?> <?php get_sidebar('page-bottom') ?> </div><!-- #content --> </div><!-- #container --> <?php thematic_sidebar() ?> <?php get_footer() ?>Permalink #
April
said
Ignore the other post. I’ve got two blogs and the one below I have no problems with. Sheesh. What a day. Anyway, here is the real live source code for page.php for artdreamlife.com! Thanks!
<?php /*------------------------------------------------------------------------ # WordPress Christmas Theme v1.1 - January 2009 # ?> <?php get_header(); ?> <!-- Main Body Start --> <div id="middle"> <div class="background layoutright"> <div id="main"> <div id="main_container" class="clearingfix"> <div id="mainmiddle" class="floatbox withoutleft"> <?php get_sidebar(); ?> <div id="content"> <div id="content_container" class="clearingfix"> <div class="floatbox"> <div class="post"> <?php if( function_exists(page2cat_pages)){ page2cat_pages($post->ID, 5, 15); } ?> </div> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="comment" id="post-<?php the_ID(); ?>"> <div class="time-comments clearingfix"> </div> <h1><?php the_title(); ?></h1> <?php the_content('<p class="serif">Read the rest of this page »</p>'); ?> <div class="single-cats clearingfix"> <div class="icons" style="float:right;"> <a href="http://technorati.com/faves?add=<?php the_permalink() ?>" title="Bookmark <?php the_title(); ?> on Technorati" class="one"></a> <a href="http://del.icio.us/post?url=<?php the_permalink() ?>&title=<?php the_title(); ?>" title="Bookmark <?php the_title(); ?> on Delicious" class="two"></a> <a href="http://digg.com/submit?phase=2&url=<?php the_permalink() ?>" title="Digg <?php the_title(); ?>" class="three"></a> <a href="http://reddit.com/submit?url=<?php the_permalink() ?>&title=<?php the_title(); ?>" title="Bookmark <?php the_title(); ?> on Reddit" class="four"></a> <a href="http://www.stumbleupon.com/submit?url=<?php the_permalink() ?>" title="Bookmark <?php the_title(); ?> on StumbleUpon" class="five"></a> </div> <div class="cats"><?php edit_post_link('Edit this entry.', '', ''); ?></div> </div> </div> <div class="navigation clearingfix"> <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?> </div> <?php endwhile; endif; ?> </div> </div> </div> </div> </div> </div> </div> </div> <!-- Main Body End --> <?php get_footer(); ?>Permalink #
GrpSmglr
said
try to take out lines 23-27 and just use this code:
<?php if( function_exists(page2cat_pages)){ page2cat_pages($post->ID, 5, 15); } ?>right after:
on line 54…let me know what happens
Permalink #
April
said
Did as you requested the page shows up but my posts are missing. Suggestions?
And thanks. This is probably some of the best customer service I’ve ever received!
Permalink #
Greg MD
said
Thanks for this great plugin. Works great for me!
It is written that “by default Category Page Extender only shows the excerpt of the post” but in my case (and as I can see also on April’s page http://artdreamlife.com/short-stories/) both the excerpt and the full content of the posts are displayed. I would to have only the excerpt to be displayed on the page.
Any help would be very appreciated.
Thank you in advance!
Greg
Permalink #
GrpSmglr
said
I’m not certain whats going on, but I have some ideas. Did you put the Category Page Extender short-code before or after “The Loop”? (the part of the the page.php where it has “if (have_posts()) : while (have_posts()) : the_post();”)
If it’s before, try moving the shortcode to after “The Loop”. (it should look something like this: “endwhile; endif;”) I think this will fix the problem.
Also if you want the formating to look like the rest of the site you may need to change the code on lines 76-88 of the category-page-extender.php file to “the Loop” your page.php file has, just make sure to swap out the_content() with the_excerpt().
Hope this helps let me know if it works.
Permalink #
Sharon
said
Hi,
I’m currently using Category Page with the shortcode on a page. It works great BUT there appears to be a problem with pagination? When you click on the link to go to the next page of posts, it just redisplays the current list of posts. So, you only ever see the first ten (or so) posts even if there are many more. Does your plug in solve this problem? WOULD LOVE IT if it did!!!
Permalink #
Sharon
said
I thought I’d add a link to the page showing the problem:
http://sfoley.horsemansarts.com/iida/board-2/
Thanks! Sharon
Permalink #
GrpSmglr
said
My plugin in works slight differently.
For one, the Category Page plugin puts a particular page on top of a category’s archive page. What my plugin does is, working off the structure of Category Page, it places posts from a particular category into a linked page. So to use my plugin you may have to structure your site slightly differently (link to pages rather than categories).
As far as the pagination goes, Category Page Extender has it’s own built in pagination function, so that should work without any problems.
Let me know if you use it and if I can be of any further help.
Permalink #
Sharon
said
Thank you for your reply. I’m not quite following what you mean about placing posts from a particular category into a linked page. Here’s what I want to do. You can see it in the URL above… I want the category archive to appear on a page accessed from a page menu. When you say structure the site different, how would it need to be different? Thanks in advance.
Permalink #
GrpSmglr
said
Do you mean post pagination? If so I’m not sure how my plugin will work with that. I built pagination around x number of posts per page. Give it a shot and let me know!
Permalink #
GrpSmglr
said
I haven’t done anything with paginated posts, but I could imagine the plugin could be easily adapted to support them.
Permalink #
Sharon
said
There are about 40+ posts in the category in question. Only about ten seem to show up. Try it out, you’ll see when you click on ‘older posts’ you only see the same ten displayed again. There is obviously something wrong with the plug in but it appears that the person who wrote it is not maintaining it any more. So no help there. I’m not ‘married’ to that plugin to getting my problem solved. So, I’m open to using a different solution.
Permalink #
GrpSmglr
said
I see what you’re talking about. Yes my plugin should work well, how ever you need to keep Category Page installed to use it, just remove the code from the category archive page. But continue to use for the category/page link.
What you need to do is have the link for Board Members go to a page (maybe called board) instead of a category archive, create a custom template (board-page) for the page and then follow the instructions above. It should work great.
Permalink #
Sharon
said
Thank you for looking! Let me make a clarification so we’re both on the same page (no pun intended!). The way I’m using the Category Page plugin is with the shortcode: [catlist=x] on a PAGE. So, I already have a page called “Board”. The Page2Cat plugin puts the ‘board members’ category archive ON the page. Not the other way around. It is very simple, which is good because I’m no coder!! Since I already have a page, will your plugin give me the same effect? The archive on the page?
Permalink #
GrpSmglr
said
oh ok. In that case delete the [catlist=x] shortcode. And if you haven’t sent up a page/category link, do that under Category Pages menu.
My plugin doesn’t use shortcodes so you need to add:
<?php if( function_exists(page2cat_pages)){ page2cat_pages($post->ID);} ?>to the page.php file (very simple), or create a template page for it, and then I recommend you replace lines 76-88 of the category-page-extender.php file with the loop statement from the page.php file in your template directory. And that should be it.
Permalink #
Walter
said
Hi, I’m an idiot when it come to code. I’ve installed both plugins, and have already checked the box I want for the Category Page. But I didn’t change any code for the Category Page plugin itself.
If it matters, I designed my “theme” with Artisteer.
All I want to do is publish posts associated with category A on the category A page, and publish posts associated with category B on the category B page.
Below is my page.php code. I’m not sure whether or not this is the only page which requires tweaking.
Can someone help me modify the code below? And, tell me if I need to modify any other code pages? Thanks much!
<a href="” rel=”bookmark” title=”">
<img src="/images/PostDateIcon.png” width=”18″ height=”18″ alt=”" />
Permalink #
Walter
said
PS looks like my message was cut off!
Permalink #
Greg MD
said
Does your page.php has this code?
ID, 0, 0);} ?>
Have you gone to the WordPress Dashboard>Pages>Edit (the page you want) and click at the bottom the “Category Page Options?”
Permalink #
Greg MD
said
My msg was also cut off!
The code is in this page just below the “Plugin Options”.
Permalink #
Walter
said
Hi, no I don’t see
ID, 0, 0);} ?>
anywhere on my page.php
Permalink #
Greg MD
said
The code was cut off.
Look for the code: php if( function_exists(page2cat_pages)){ page2cat_pages($post->ID,0,0);}
(I deleted one at the end, I think this is the reason for cutting the messages).
Permalink #
GrpSmglr
said
right after THE LOOP in your page.php file paste this line:
<php if( function_exists(page2cat_pages)){ page2cat_pages($post->ID,0,0);} ?>(to get the code to show up on these comments, you need to use html char codes for < (<) and > (>) around the ?php part of the code.)
You may still need to tweak the category-page-extender.php so that the posts match your theme. The easiest way to do this is to copy the loop from the page.php file (or the index.php) replace lines 76-88 of category-page-extender.php with the loop from your page.php (see image above).
Permalink #
Walter
said
Greg, weird, my page.php doesn’t have that. (I used the “find” feature in dreamweaver) I suspect that this is because I’m using an Artisteer theme, and it may have its own way of doing things.
Permalink #
Greg MD
said
Add the code. Paste the line GrpSmglr indicated.
Permalink #
Walter
said
another try at posting my entire page.php code:
<
<a href="” rel=”bookmark” title=”">
<img src="/images/PostDateIcon.png” width=”18″ height=”18″ alt=”" />
>
Permalink #
Walter
said
I think I better give up. it will be easier to start a seperate blog.
Permalink #
GrpSmglr
said
walter I just emailed you…email me the code and I’ll take a look at it.
Permalink #
Artisteer-user
said
Same problem here, with Artisteer?
Did you guys find a solution?
Permalink #
GrpSmglr
said
i just sent you an email
Permalink #
Sharon
said
OK I did what I THOUGHT I should do, but nothing is showing. So obviously I’ve missed something. I’m using the Atahualpa theme, btw. Do you know anything about that theme?
Permalink #
GrpSmglr
said
sharon, check out thomas’s reply. That should work well using the [catlist=5] shortcode.
Permalink #
Thomas Gordon
said
Hey guys, love the plugin, I think I have the solution to what a lot of people here are talking about, open the category plugin php file and look for
//Permalink for page scrolling
$base_link = get_permalink();
if ( strcspn($base_link,’?') > 0){
$variable_prefix = ‘&’;
} else {
$variable_prefix = ‘?’;
}
If you’re using a different permalink structure to the default, you may have to change $variable_prefix = ‘&’; to $variable_prefix = ‘?’;
Before the plugin just refreshed the same list of posts but now it all works very well for me.
Thanks again.
Permalink #
Sharon
said
Hey Thomas,
can I ask a question? Are you saying that the result would be changing this:
That sounds encouraging. I found the code you mention but since I don’t know what I’m doing
‘if ( strcspn($base_link,’?’) > 0){
$variable_prefix = ‘&’;
} else {
$variable_prefix = ‘?’;
}’
to
‘if ( strcspn($base_link,’?’) > 0){
$variable_prefix = ‘?’;
} else {
$variable_prefix = ‘?’;
}’
Or have I missed something?? I’d sure love to fix this problem!
Permalink #
GrpSmglr
said
hey sharon,
I fixed the pagination error and you can download the new version at http://wordpress.org/extend/plugins/category-page-extender/ .
I also sent you an email if you want more specific help.
Permalink #
Sharon
said
Hi,
I uploaded the new plugin version (Yay!) but I’m still having the same problem. But then at the moment I’m still using the shortcode [catlist=5]. Were you thinking that your fix would solve that problem? Maybe not.
Maybe I just don’t understand how the plugin is supposed to be set up? I’m using the Atahualpa theme which is highly customizable. So, there isn’t a page.php file, per se. There is a place where code can be added ‘below the loop’. I put your code there (figured that was the right thing to do) but ended up with an error msg on the front page.
This project doesn’t, I’ll admit, really warrant investing in customized solutions! So, for now (unless I can figure out how to set it up right!) I’m making a Plan B which involves avoiding the whole thing all together–just put a link to the archive page on the sidebar!
Thanks for everything!
Sharon
Permalink #
GrpSmglr
said
sharon, I just sent you an email.
Permalink #
piotrkolodziej
said
Hi,
I am using INove theme which has slightly different page.php:
<div class="post" id="post-”>
<?php edit_post_link(__('Edit', 'inove'), '’, ”); ?>
I do not seem to know where to put the:
ID);
} ?>
line.
Could you help me with that?
Kind Regards
Piotr Kolodziej
Permalink #
piotrkolodziej
said
Ops…. Sorry about that:
Inove theme’s page.php:
<?php get_header(); ?> <?php if (have_posts()) : the_post(); update_post_caches($posts); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><?php the_title(); ?></h2> <div class="info"> <span class="date"><?php the_modified_time(__('j F, Y', 'inove')); ?></span> <?php edit_post_link(__('Edit', 'inove'), '<span class="editpost">', '</span>'); ?> <?php if ($comments || comments_open()) : ?> <span class="addcomment"><a href="#respond"><?php _e('Leave a comment', 'inove'); ?></a></span> <span class="comments"><a href="#comments"><?php _e('Go to comments', 'inove'); ?></a></span> <?php endif; ?> <div class="fixed"></div> </div> <div class="content"> <?php the_content(); ?> <div class="fixed"></div> </div> </div> <?php include('templates/comments.php'); ?> <?php else : ?> <div class="errorbox"> <?php _e('Sorry, no posts matched your criteria.', 'inove'); ?> </div> <?php endif; ?> <?php get_footer(); ?>and the line:
<?php if( function_exists(page2cat_pages)){ page2cat_pages($post->ID);} ?>Permalink #
GrpSmglr
said
<?php endif; ?> <?php if( function_exists(page2cat_pages)){ page2cat_pages($post->ID);} ?> <?php get_footer(); ?>Put it there.
Permalink #
piotrkolodziej
said
Now the page only displays it’s text – no posts assigned to category which is assigned to this page.
Permalink #
GrpSmglr
said
try changing the function to:
<?php if( function_exists(page2cat_pages)){ page2cat_pages(get_the_ID());} ?>or
<?php $curpageid = get_the_ID(); if( function_exists(page2cat_pages)){ page2cat_pages($curpageid);} ?>Permalink #
piotrkolodziej
said
Is there a way to display only posts – not page unique post? It seems that page’s unique post is dispayed always at the top. Here is my solution:
<?php get_header(); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><?php the_title(); ?></h2> <div class="info"> <span class="date"><?php the_modified_time(__('j F, Y', 'inove')); ?></span> <?php edit_post_link(__('Edit', 'inove'), '<span class="editpost">', '</span>'); ?> <?php if ($comments || comments_open()) : ?> <span class="addcomment"><a href="#respond"><?php _e('Leave a comment', 'inove'); ?></a></span> <span class="comments"><a href="#comments"><?php _e('Go to comments', 'inove'); ?></a></span> <?php endif; ?> <div class="fixed"></div> </div> <div class="content"> <?php if( function_exists(page2cat_pages)){ page2cat_pages($post->ID);} ?> <?php the_content() ?> <div class="fixed"></div> </div> </div> <?php include('templates/comments.php'); ?> <?php endwhile; endif; ?> <?php get_footer(); ?>Permalink #
GrpSmglr
said
that could work, although I’d recommend making a separate page template (if you don’t know how go here: http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates ).
Then just take out line 20 on your code above because I think that may cause the last post’s content to be repeated.
Permalink #
Daniel
said
I installed the new version and the plugin stopped working on changing pages! Can you post the old version? Thank you.
Permalink #
GrpSmglr
said
how long ago did you update it? I realized I made an error and altered ver 1.0.2 about 24 hours after first uploading it. Try downloading it again and if it doesn’t work let me know. You can also download older versions here: http://wordpress.org/extend/plugins/category-page-extender/download/
Anyone else having problems with ver 1.0.2?
Permalink #
Daniel
said
OK! Downloaded again and worked liked a charm! Thanks!
Permalink #
Aaron
said
Can you tell how to get it working in an thematic framework environment? How do I filter that very first snippet “if function exists cat page2cat…” into my thematic childtheme?
I made the page2cat content show up already on a page but it obviously was not quite on the right place in the code.
please help, if it works this plugin is exactly what I need.
Thanks, Aaron
Permalink #
GrpSmglr
said
I don’t understand what you’re trying to do exactly. Can you send me a link to your site/page?
Permalink #
Aaron
said
Hi, thanks for quick response. I’m building my website on http://179263.webtest.goneo.de/wordpress/
Just a blank WP with a blank thematic childtheme with some posts and categories. Category Page and Category Page Extender are installed and activated.
Above you recommend tweaking the page.php file with this code:
<?php if( function_exists(page2cat_pages)){ page2cat_pages($post->ID); } ?>Ok I understand that generally but I don’t have a clue how to insert the code via thematic’s functions.php
And bringing it directly into the page.php is diffcult either because the abovementioned loop statement isn’t written out in thematic’s page.php but is hidden in some thematic function
Permalink #
GrpSmglr
said
it looks like you got it figured out. Are you still having problems?
Permalink #
Jordan
said
Aaron,
I’m also using the thematic theme and I’m having trouble identifying where I have to insert the text in the page.php file.
Please advise.
-Jordan
Permalink #
GrpSmglr
said
It looks like the best place to put the code would be on line 20 (of the original template) right below:
you could also try to put it right before the code above.
If you are still having problems try replacing the:
$post->ID
in the plugin function with :
get_the_ID()
Let me know how it works.
Permalink #
Jordan
said
I’ve tried placing the code there and it still doesn’t seem to be doing what it should.
Here’s the code as I believe you have suggested.
<?php get_header() ?> <div id="container"> <div id="content"> <?php get_sidebar('page-top') ?> <?php the_post() ?> <div id="post-<?php the_ID(); ?>" class="<?php thematic_post_class() ?>"> <?php thematic_postheader(); ?> <div class="entry-content"> <?php the_content() ?> <?php wp_link_pages("\t\t\t\t\t<div class='page-link'>".__('Pages: ', 'thematic'), "</div>\n", 'number'); ?> <?php edit_post_link(__('Edit', 'thematic'),'<span class="edit-link">','</span>') ?> </div> </div><!-- .post --> <div class="post"> <?php if( function_exists(page2cat_pages)){ page2cat_pages($post->ID); } ?> </div> <?php if ( get_post_custom_values('comments') ) thematic_comments_template() // Add a key+value of "comments" to enable comments on this page ?> <?php get_sidebar('page-bottom') ?> </div><!-- #content --> </div><!-- #container --> <?php thematic_sidebar() ?> <?php get_footer() ?>Permalink #
GrpSmglr
said
try replacing
with
I think because $post was never defined in this page template, you have to use get_the_ID()
Permalink #
John P. Neumann
said
I applaud you for doing what you did with the extender. I’ve modified the actual plugin to show only excerpts of a page instead. If you’d like you can check it out at http://wordpress.org/support/topic/356177 . If you’ve got something to input to it feel free. I actually redid the plugin so it worked better for me, but I actually am going to abandon using it entirely I think.
However, I wanted to let people know how to get what they wanted out of it. Cheers
Permalink #
John P. Neumann
said
I’ve now updated the plugin and it can be downloaded from the previous link I provided. It adds the option to display full posts or just excerpts from within the admin panel of the original plugin. Just copy my code and replace the code in page2cat.php and that’s that. You can use any theme now without modifying it in any way shape or form. HTH.
Permalink #
Shea
said
Help please!
http://blog.opportunitygreaterphoenix.com/?page_id=1112
As you can see, 5 excerpts display nicely, but then the last also displays the whole post.
Ideally, I’d like all five posts to display their full content.
I’ve copied my page.php code below. Keep in mind, I don’t really know what I’m doing. A consultant company created the original code, and now I’m just trying to tweak it.
Any help would be much appreciated!
ID, 5, 0);
} ?>
Posted
on , ,
by ,
under .
<?php the_content('Read the rest of this page »’); ?>
‘Pages: ‘, ‘after’ => ”, ‘next_or_number’ => ‘number’)); ?>
Permalink #
Shea
said
Whoa – okay, my way of posting the code did not work. Have any ideas without seeing the code?
Permalink #
John P. Neumann
said
I don’t mean to be a jag, but instead of modifying your actual page templates you could just replace your original page2cat.php file with the one posted here http://wordpress.org/support/topic/356177 and then just choose excerpt or post in the original page2cat admin panel. Then you just make your template however you normally would and make your pages and link the categories to the pages like that. It has support for both excerpts and full posts. The only reason I’m not releasing it as a full plugin (and just an enhancement) is because support for it would be very little due to my own time constraints.
It just seems like the plugin is doing a whole lot to achieve very little, whereas you can just use the plugin and use your templates like you normally would.
Permalink #
Shea
said
Thanks John, but how do I replace the page2cat.php file? It tells me it’s not a writable file. And the link it suggests going to for help makes no sense to me.
Permalink #
GrpSmglr
said
john, I agree that the [catlist=xx] feature is simpler to use that setting up this plugin; however my plugin serves a slightly different purpose. Also I do like the addition you made of the excerpt/full post option.
First, once it’s setup, there is no need to use the catlist feature, just check the box on the page.
Second, it incorporates pagination. With the catlist feature (to my knowledge) if you choose to limit the number of posts there’s no way to seem older posts in the category other than clicking on the category archive, which although isn’t that difficult, it decreases the professionalism of a site.
Finally, it is designed to make updating as simple as possible for people with no knowledge of how the system works.
Permalink #
GrpSmglr
said
also, I edited your comment, please mind the language.
Permalink #
Choyce
said
Hi i am totally new to wordpress and i am using the Tarski theme http://tarskitheme.com/. I love the idea of this plugin but my lack of php coding knowledge has lead me to a brick wall. The theme that i am using doesnt have a page.php and even with the link that you had for us to read i am stumped on what to write in my new (post to page.php) file..
<?php /* Template Name: post to page */ ?> <?php get_header(); ?> <div class="post"> <?php if( function_exists(page2cat_pages)){ page2cat_pages($post->ID); } ?> </div> <?php if( function_exists(page2cat_pages)){ page2cat_pages($post->ID, 10, 10); } ?>Any help at all would be so amazing.. This is driving me crazy..
Permalink #
GrpSmglr
said
Looking at the theme, I think you can avoid creating your own template. Since the theme only uses the index.php towards the bottom of index.php you should see:
<?php } else { // If no posts ?> <?php include(TARSKIDISPLAY . "/no_posts.php"); ?> <?php } // End loop ?>right under the //End Loop line (on line 55 of original template file) try wrapping the plugin code with and is_page() if statement. i.e.
<?php if (is_page()){ if( function_exists(page2cat_pages)){ page2cat_pages(get_the_ID(), 10, 10); } }That should do the trick. For a small fee I also will install the plugin for you (check your email).
Good luck!