+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Where to insert WP-Paginate code?

  1. #1
    Junior Member
    Join Date
    Feb 2011
    Posts
    2

    Where to insert WP-Paginate code?

    Hi,

    Thank you for an OUTSTANDING theme
    I've tried all kinds of themes, but I've never seen at theme that's more flexible than Catalyst/Dynamik Your service also seems to be unique! I really hope you'll continue to update and develop Catalyst/Dynamik.

    I want to use the WP-Pagination plugin on one of my sites. The site will display several page with lists of addresses and I'd like to make it easier for the users to go to the different pages with the lists.

    In the installation instructions the author of the plugin says that you should replace your "existing previous_posts_link() and next_posts_link() code block" in "the loop.php file or the index.php, archive.php and search.php files" with the following code:

    Code:
    <?php if(function_exists('wp_paginate')) {
        wp_paginate();
    } ?>

    Could anyone please advice me where and how I can add this code in Catalyst/Dynamik so that the pagination is shown on the blog pages (not the posts)?

    I've tried to create a custom hook in Catalyst and to insert the code in that hook, but for some reason the custom hook doesn't seem to be either saved or to be displayed on the blog pages.

    Should I rather try to change the code of the php-files in Catalyst/Dynamik? So far as I can see, the code for the "Previous post" and "Next post" is in the catalyst-content php file, but if there's an easier way to insert the pagination php-code (pointing to the WP-Pagination plugin), I'd prefer to do that. I'm certainly not a professional programmer and don't want to make a mess in the php-code of Catalyst/Dynamik.

    Thank you very much in advance!

    Best,
    Klaus

  2. #2
    Catalyst Developer eric's Avatar
    Join Date
    Dec 2010
    Posts
    6,313
    Hey Klaus,

    Try adding the following code to your /wp-content/themes/dynamik/custom-functions.php file:

    PHP Code:
    remove_action'catalyst_hook_after_endwhile''catalyst_build_post_nav' );
    add_action'catalyst_hook_after_endwhile''custom_build_post_nav' );
    function 
    custom_build_post_nav()
    {
        if( 
    function_exists'wp_paginate' ) )
        {
            
    wp_paginate();
        }

    Eric

  3. #3
    Junior Member
    Join Date
    Feb 2011
    Posts
    2
    Hey Eric,

    Thank you very much That solved the problem.

    I really appreciate your help!

    Warmly,
    Klaus

  4. #4
    superetftrader
    Guest
    I installed the WP-Pagination plugin and put the above code into /wp-content/themes/dynamik/custom-functions.php file and got no luck. I'm new to this. Am I missing something or is there any more docs to read more on adding Pagination would be very helpful. Can someone point me in the right direction to add Pagination. I have tons of post and set 10 post per page. I need to add a Pagination on the bootom of my post page page to advance to the next page to continue to see the next list of 10 posts. I search all over the Forum, Google and Wordpress and still could not get this to work. Thank you.

  5. #5
    Senior Member bambo's Avatar
    Join Date
    Feb 2011
    Location
    Denmark
    Posts
    3,650
    I just tried this and it works. Or technically it works. You will most likely need to customize the new pagination as it looks horrible out of the box.

    I would untick "WP-Paginate CSS File:" setting as to make sure your CSS changes does not get overridden when plugin updates. Copy all content in to Catalyst Custom CSS and modfify away.

    Plugin does not pick up a child theme like Dynamik properly so what he says about putting file in theme folder wont work - not a good idea to place in Catalyst folder.

    May be you could paste in entire content of your custom-functions.php ? Click "Go Advanced" in this forum editor and then mark all code, click the code button, looks like "#" - or the one that says PHP. Something must be wrong some where. You are using this http://wordpress.org/extend/plugins/wp-paginate/ ?
    Last edited by bambo; 03-15-2012 at 11:28 AM.

  6. #6
    superetftrader
    Guest

    custom-functions.php

    Yes I am using http://wordpress.org/extend/plugins/wp-paginate/
    I did uncehck WP-Paginate CSS File
    I still don't see Paginate on the bottom of my page.

    When you said "Copy all content in to Catalyst Custom CSS and modfify away."
    Copy what into where? And modify what? I am new at this.

    Here's my custom-functions.php from
    wp-content/themes/dynamik


    <?php

    /* Put Any Custom PHP Functions For Your WordPress Site In This File */

    remove_action( 'catalyst_hook_after_endwhile', 'catalyst_build_post_nav' );
    add_action( 'catalyst_hook_after_endwhile', 'custom_build_post_nav' );
    function custom_build_post_nav()
    {
    if( function_exists( 'wp_paginate' ) )
    {
    wp_paginate();
    }
    }


    //end custom-functions.php

  7. #7
    Senior Member bambo's Avatar
    Join Date
    Feb 2011
    Location
    Denmark
    Posts
    3,650
    When/If you get it to work you should copy all content of the now disabled CSS file wp-paginate.css in to Catalyst CSS. When you untick that box there is no CSS applied. Not that it matters right now as plugin dont work.

    This information is also available on "Installation" tab at .org site. If you installed plugin from WP backend then dont do that again unless plugin is known. Some devs cant be bothered to give a min. amount of info but some do and you definitely want to get that.

    PHP looks ok so dont know - a guess could be a conflict with other plugin. You could try to disable possible offenders, 1 by 1. When doing that be sure that settings are not forgotten when you reactivate again. Some plugins has this hidden bug and so you go from bad to worse if not knowing.

    If you check .org forum you can see loads of problems but as said it does work on Catalyst so no deeper conflicts there. You can start from page 1 and check if anything is relevant.

    That is all you need to know

  8. #8
    superetftrader
    Guest
    I never got it to work. Maybe you're not understanding what I mean.
    Here is my web site: hottdl dot com
    I have tons of post and I set each page to display a max of 10 posts.
    How do I set at the bottom of the page to advance to teh next page to display the next 10 posts?
    Here's a sample os another site I found on the internet trott dot tv
    Please go to trott dot tv and look at the bottom of it's page. He have Page Navigation to advave to another page to see more posts.
    Please let me know if this is something that can be done. I know it can be done, because I see it done at trott dot tv site.
    Thank you

  9. #9
    Senior Member bambo's Avatar
    Join Date
    Feb 2011
    Location
    Denmark
    Posts
    3,650
    But it does work - just not on home page which is a page of sorts. Not paginated. Your category and tag archives have the unstyled numbers from wp-paginate. You can do basic styling by pasting the code in to Catalyst Custom CSS from mentioned CSS file.

    The other site you link use default Catalyst post navigation, see those in core options, content tab. 3 to pick from. Might be a nice new feature in Catalyst to be able to see more than a handful of numbers.
    Last edited by bambo; 03-16-2012 at 09:56 AM.

  10. #10
    superetftrader
    Guest
    I just changed my home page from Catalyst Excerpts Plus Special Filters Random to none, so now it's displaying Latest Posts in order. Now how I do I add "Next page" to the bottom of the HOME PAGE so I can advance to the next page and see the next 10 posting? How hard can this be? Can this be done? I have 60 posts in category "StockMarket" and on the home page it only display 10 posts. How do I add a Next button to advance to the next page to see the next 10 posts. Can you please show me how to do this PLEASE, PLEASE, PLEASE!!! I juts need to get thsi to work and move on!!! THANK YOU SO MUCH IN ADVANCE!!! If you click on the Stock Market Page, it is the same thing. I REALLY need this to work. Please help me!!!

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts