Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Forum: Plugins
    In reply to: Hide Custom Menu widget
    Thread Starter astrotim

    (@astrotim)

    Brilliant, thank you. Naming convention out the window on that one.

    astrotim

    (@astrotim)

    I had a site with custom post types turn into a mess following an upgrade to WordPress 3.1. I have written a post about how I fixed the invalid post type issues I was having.

    astronautdesigns.com/2011/03/wordpress-3-1-upgrade-invalid-post-type-error/

    astrotim

    (@astrotim)

    I had a site with custom post types go pear-shaped following an upgrade to version 3.1 today. The permalinks were not working in the front end and I got an error stating “invalid Post Type” in the back end. I could not edit any of the custom posts either, only view them. It was a mess!

    I fixed the problem by changing the post_type value to all lowercase and adding flush_rewrite_rules function to the register_post_type function. See my invalid post type article for more details.

    astronautdesigns.com/2011/03/wordpress-3-1-upgrade-invalid-post-type-error/

    astrotim

    (@astrotim)

    Hi Patrick,

    Are you sure that you don’t mean navigation instead of pagination? Pagination is the dividing of long content into smaller sections over multiple pages, like if you had 20 projects in your portfolio and you wanted the portfolio page to show only the first 10, with the next 10 on “page 2”.

    What you seem to be describing is sequential navigation through the list of portfolio posts, eg: “previous post | next post”. This, as far as my understanding goes, is not pagination.

    My code sample that you have included above should be added to the single.php file, not the portfolio.php file. As keesiemeijer has pointed out above, you need to have a single post template file such as single.php for the “next post” and “previous post” navigation links to work.

    In the case of a portfolio, your portfolio.php file acts like index.php, where the loop will display all posts (as you have specified numberposts => 999) with title, thumbmail, read more, etc. Then when you click a link to an individual post, your theme will look for the single.php file to display the complete post. It is here that you can add the navigation “Previous | Next”. These links will reload single.php with new single post content, while returning to portfolio.php will load all posts in the “thumbwrapper” format you have specified.

    Just to clarify–

    Pagination is the division of your complete list of posts into smaller sections across multiple pages, such as on my blog index page here: https://www.astronautdesigns.com/blog. This can only be done on in a post index file such as index.php or portfolio.php.

    -vs-

    Sequential navigation is a single post that has next post and previous post links that move backwards and forwards through your sequence of posts in the full single post format. This must be done on a single.php or equivalent file. My code sample you have included above is form this page which is using the single.php file.

    Which one is it that you want?

    I confirm that mattifesto’s solution also worked for me. I have been using permalinks with my custom post types without this additional function until recently; I’m not sure why it is now necessary – perhaps a core change in a recent WordPress update.

    I have added this function to the code in my post about custom post types here:
    astronautdesigns.com/2010/06/wordpress-3-custom-post-types/#permalink_404

Viewing 5 replies - 1 through 5 (of 5 total)