Category Page Extender Plugin

Wordpress Plugin to insert posts into pages by category

User Instructions

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:

  1. First install category page by pixline
  2. Download the plugin Zip archive.
  3. Upload `Category Page Extender` folder to your `/wp-content/plugins/` directory
  4. Activate the plugin through the ‘Plugins’ menu in WordPress
  5. Setup some relationships between Categories and Pages using the Category Page plugin (see Category Page documentation here)
  6. Tweak `page.php` in your theme folder (see below).
  7. 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($post->ID);} ?>

I recommend you wrap the function in your standard post class. For example:

<div>
<?php if( function_exists(page2cat_pages)){ page2cat_pages($post->ID);} ?>
</div>
<div class="post">
<?php if( function_exists(page2cat_pages)){ page2cat_pages($post->ID);} ?>
</div>

Plugin Options

<?php if( function_exists(page2cat_pages)){ page2cat_pages($post->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($post->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($post->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($post->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 81 with:

<?php the_content() ?>

See image below:

category-page-post-code

6 Responses to “User Instructions”

  1. 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?

  2. Sorry/ Forgot to use code quotes:

    ID=15, 20);} ?>

  3. 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);} ?>

  4. 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

  5. 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.

  6. 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

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>