• Resolved NFWRo

    (@nfwro)


    Hi all
    I have had a report on one of my sites that the ‘blog’ area, used for news and events, is returning a page not found error. Looking at the website logs, I found the error:
    rockbournevillagehall.org.uk [Tue Dec 17 00:52:57 2013] [error] [client 5.10.83.39:54493] AH01215: WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 for query SELECT post_modified FROM wp_posts WHERE id = made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/rvh/404.php'), get_footer, locate_template, load_template, require_once('/themes/rvh/footer.php'), mdv_last_modified

    Having Googled it, I find that this is not uncommon, but many of the errors reported actually have some code in between the single quotes where it says ‘for the right syntax to use near’, but I have little to go on.

    Going by advice given in other threads, I tried going back to a default theme and disabling all plugins which made no difference. I also tried returning to the default Permalink structure. That worked and all posts displayed. This led me to believe that it may be category based.

    Looking at the categories, two posts were incorrectly marked as Uncategorized, so I fixed those to have the correct category and put my Permalink structure back to how it should be /%category%/%postname%/. Now the Not Found error has gone and the initial error is no longer appearing in the logs, but only those two posts that I fixed are displaying and no others.

    The only changes to the site lately have been some additions to the styles and editor styles to support the use of a different font in the most recent post.

    Please could anyone point me in the right direction as to how to track down what is causing this error?

    The site is https://www.rockbournevillagehall.org.uk.

    Any advice is much appreciated.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Could you give the link to the blog home page?

    Thread Starter NFWRo

    (@nfwro)

    So, you have a category events and films? Are both supposed to show up on the blog home, with the category events slug?
    Have you checked the number of blog posts to show in the settings?

    Thread Starter NFWRo

    (@nfwro)

    I have three categories, events, film nights and news. The blog home page is called events and all three should show up on that page. Up until now, they have been successfully.

    The number of blog posts to show is set to 10 and that also has been working until now.

    Have you reviewed your index.php template file?

    I’m also slighty wondering if there’s isn’t a conflict between the blog page /events/ and the category archive /events/.

    Thread Starter NFWRo

    (@nfwro)

    Hi Peter
    Well now, I just changed the name of my page to films-events and everything is back! Thank you so much for that lead.

    I must admit though – I’m at a loss to understand why the original error occurred given that, at that stage, there was nothing assigned to the events category. Can you shed any light on that, just for future understanding?

    Thanks again for your help.

    Well, if you call the blog home page (= post type: page) /events/ and you have a category /events/ then there’s bound to be a conflict as these are completely different things.

    Events an empty category events (with no posts) would be a problem as this would return – an empty – but still a category page.

    Mark post as resolved please unless you have more questions.

    Thread Starter NFWRo

    (@nfwro)

    Thank you Peter – marked resolved with thanks.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Category issue’ is closed to new replies.