Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • This solution sometimes works for me:

    1. Change permalink settings to default
    2. View page*
    3. Revert permalink setting to however it was before

    *Optional step, but I do it to make sure I haven’t accidentally made a programming error, such as an infinite loop

    Thread Starter markgia

    (@markgia)

    /%post_id%/%postname%/ results in 404. Any ideas what I can do?

    Thread Starter markgia

    (@markgia)

    Thanks for the reply Roy! Good to know its not just an isolated case.

    I’ll go down your route and try and modify the permalink with some hooks/filters.

    Forum: Fixing WordPress
    In reply to: Switching Domains

    No problem David.

    Have you transferred your site over to your .com domain or is it still sitting on your byehost account?

    If your site has been transferred to your new domain then nothing should be on your old domain. It would be safe to edit the existing index.php on your byehost.com site. Before you do this can you confirm that the site is fully functioning on your new domain?

    Forum: Fixing WordPress
    In reply to: Switching Domains

    Create an index.php with the following code:

    <?php
    header("Location: http://www.yoursite.com/"); /* Redirect browser */
    
    exit;
    ?>

    And upload to your byehost.com root folder.

    Thread Starter markgia

    (@markgia)

    get_menu_items_by_course returns an array of posts and I would like to use an add_filter function on each of these posts before they are displayed on screen. If you are in the loop then you could use ‘the_content’ hook however I’m creating a custom loop so I cannot use this hook.

    Its so plain to see now! I was limiting register_post_type(); to the admin dashboard and of course the template has to have access to the arguments as well to display it correctly!

    Oh things were so much simpler in C++ (never thought I’d ever say that)

    Thanks Dion,

    I followed your advice but I think my problem lies elsewhere.

    I have two plugin files – main.php and admin.php

    main.php includes admin.php when is_admin() == true and I call register_post_type(); inside admin.php

    My custom post type would work when I leave the $rewrite argument undeclared but assume I defined 'slug' => food_items the post would not be found. I tried changing permalink settings and calling flush_rewrite_rules(); but no luck.

    Eventually I placed the code in functions.php and hey presto! Everything worked as you would expect. Even changing the slug argument in $rewrite array worked everytime without having to mess with permalink settings.

    Rapidz are you declaring custom post types in your plugin? If so I would suggest moving the code over to a single file if you haven’t done so already.

    Does anybody have any insight in to why custom post types aren’t working when I create them in include files?

    I’m having the exact same problem. I’m creating a plugin which requires a custom post type. The admin side of things is perfect but posts aren’t showing. Even when I preview before publishing posts are not displayed.

    Have you managed to resolve this problem rapidz?

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