• Resolved douglasbell01

    (@douglasbell01)


    Hello,

    I’ve been trying to code a query post into the site’s index.php so that the ‘news’ category shows up in the ‘news feed’ – with all other categories excluded. The category ID=1 for ‘news’.

    This idea worked perfectly for me on another theme, but this time it throws up an ‘syntax error on line 25’ of Index.php – I could do with some expert advice on solving this. Maybe I need to sort out the line spacing, maybe a stray/missing bracket? Any tips on fixing this code would mean a lot.

    [Code moderated as per the Forum Rules. Please use the pastebin]

Viewing 2 replies - 16 through 17 (of 17 total)
  • Thread Starter douglasbell01

    (@douglasbell01)

    David, you’re a legend! I was playing with the endif, when my concentration was broken by a phone call, so must have cut it and not put it back!

    Index.php now working perfectly (having changed the quesry slightly to:

    <?php query_posts(‘category_name=news’); ?>

    Link to modified Gridfocus Index.php file for other users: https://pastebin.com/LEUcwwC7

    Glad you got it sorted. ??

    Can you mark the thread as resolved. Thanks.

Viewing 2 replies - 16 through 17 (of 17 total)
  • The topic ‘Category Exclusion… small Index.php Coding Problem –’ is closed to new replies.