Title: markgia's Replies | WordPress.org

---

# markgia

  [  ](https://wordpress.org/support/users/markgia/)

 *   [Profile](https://wordpress.org/support/users/markgia/)
 *   [Topics Started](https://wordpress.org/support/users/markgia/topics/)
 *   [Replies Created](https://wordpress.org/support/users/markgia/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/markgia/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/markgia/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/markgia/engagements/)
 *   [Favorites](https://wordpress.org/support/users/markgia/favorites/)

 Search replies:

## Forum Replies Created

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

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [500 Internal Error Fix](https://wordpress.org/support/topic/500-internal-error-fix/)
 *  [markgia](https://wordpress.org/support/users/markgia/)
 * (@markgia)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/500-internal-error-fix/#post-1857910)
 * 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
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Permalink issue with custom post types](https://wordpress.org/support/topic/permalink-issue-with-custom-post-types/)
 *  Thread Starter [markgia](https://wordpress.org/support/users/markgia/)
 * (@markgia)
 * [15 years ago](https://wordpress.org/support/topic/permalink-issue-with-custom-post-types/#post-2231731)
 * /%post_id%/%postname%/ results in 404. Any ideas what I can do?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Permalink issue with custom post types](https://wordpress.org/support/topic/permalink-issue-with-custom-post-types/)
 *  Thread Starter [markgia](https://wordpress.org/support/users/markgia/)
 * (@markgia)
 * [15 years ago](https://wordpress.org/support/topic/permalink-issue-with-custom-post-types/#post-2231724)
 * 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](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Switching Domains](https://wordpress.org/support/topic/switching-domains-3/)
 *  [markgia](https://wordpress.org/support/users/markgia/)
 * (@markgia)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/switching-domains-3/#post-2158300)
 * 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](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Switching Domains](https://wordpress.org/support/topic/switching-domains-3/)
 *  [markgia](https://wordpress.org/support/users/markgia/)
 * (@markgia)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/switching-domains-3/#post-2158238)
 * 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.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How to add filter on posts retrieved from WP_Query object?](https://wordpress.org/support/topic/how-to-add-filter-on-posts-retrieved-from-wp_query-object/)
 *  Thread Starter [markgia](https://wordpress.org/support/users/markgia/)
 * (@markgia)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/how-to-add-filter-on-posts-retrieved-from-wp_query-object/#post-2155067)
 * `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.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [custom post types – not found (or infinite loop)](https://wordpress.org/support/topic/custom-post-types-not-found-or-infinite-loop/)
 *  [markgia](https://wordpress.org/support/users/markgia/)
 * (@markgia)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/custom-post-types-not-found-or-infinite-loop/#post-2145544)
 * 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)
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [custom post types – not found (or infinite loop)](https://wordpress.org/support/topic/custom-post-types-not-found-or-infinite-loop/)
 *  [markgia](https://wordpress.org/support/users/markgia/)
 * (@markgia)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/custom-post-types-not-found-or-infinite-loop/#post-2145543)
 * 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?
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [custom post types – not found (or infinite loop)](https://wordpress.org/support/topic/custom-post-types-not-found-or-infinite-loop/)
 *  [markgia](https://wordpress.org/support/users/markgia/)
 * (@markgia)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/custom-post-types-not-found-or-infinite-loop/#post-2145541)
 * 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)