How do I bypass WordPress 404 handling?

If you have a non-static request like: example.tld/some-slug/ then you will need to run WordPress to see if that slug is available. The webserver (nginx/apache) doesn’t know that, because WordPress will have to inform us about that through the 404 response header. If your site has only few pages, then you could tell the webserver … Read more

Pagination gives 404 in template

I did what Rarst told me to do. First I searched around in the Pods Framework documentation. This solved my problem. Here’s what the code looks like right now. <?php $params = array( ‘orderby’ => ‘publish_date.meta_value DESC’, ‘limit’ => 10 ); $fltNewsPods = pods( ‘fltnews’, $params ); while ($fltNewsPods->fetch()) { echo “<li class=”content-list-item”>”; $podsForNewsItem = … Read more

How to edit 404 content via wp editor?

Found a way. Create a regular page for 404 content, say ‘Page not found’; In your 404.php file, get that page data and then write down your content or whatever… For example: $page = get_page_by_title(“Page not found”); if($page) echo apply_filters(‘the_content’,$page->post_content); Obviously, you can do a lot more…

Custom Post Type rewrite rules not working, how to alter the rewrite order?

While you’ve found the problem already, here is some basic code to move a specific rule to the end of the rewrite rules with the rewrite_rules_array filter for people stumbling across a similar problem. Say I want to move the rule for ([^/]*)/([^/]*)/?$: add_filter(“rewrite_rules_array”, function($rules) { $keys = array_keys($rules); foreach($keys as $rule) { if($rule == … Read more