• I’ve dialed down my problem, basically I don’t use the default index.php file. I instead use my own and within the body tag, I have a php script which populates the posts as desired (derekknox.com/lab). I tested using the default index.php file and the RSS feed works properly (indeed strictly RSS and no HTML). But, when I use my custom index.php file, the same RSS feed is now populated (prepended) automatically with the HTML content from my index.php file (derekknox.com/lab/?feed=rss2).

    Is there a way to prevent this from happening so the RSS remains strictly RSS?

    Thanks for your help ahead of time.

Viewing 10 replies - 1 through 10 (of 10 total)
  • does your custom index page call the standard header for your theme?

    You must use the header.php and footer.php template files in your custom template as both files contain hooks that are essential for WordPress.

    Thread Starter DerekKnox

    (@derekknox)

    No, this is the (require code)

    <?php
    		require('./wp-blog-header.php');
    	?>

    The next place I’m using php is in the body tag to populate the body with my wordpress posts.

    Thread Starter DerekKnox

    (@derekknox)

    @esmi

    WordPress states in Integrating WordPress with your website to the code

    <?php
    /* Short and sweet */
    define('WP_USE_THEMES', false);
    require('./wp-blog-header.php');
    ?>

    or

    <?php
    require('./wp-blog-header.php');
    ?>

    where both basically state that WordPress is not to use any themes (‘WP_USE_THEMES’, false).

    Are you running this inside your WordPress site? Only the approach you’re using is for sites that are separate from WordPress.

    Thread Starter DerekKnox

    (@derekknox)

    The site is my own hosted site, and I’m using wordpress for the blog section of my site titles “lab” hence the (derekknox.com/lab) url.

    I just changed the

    <?php
    require('./wp-blog-header.php');
    ?>

    To the first line of my index.php file. It now validates this part, but the excess html makes the RSS invalid. Check here and let me know what you think (thanks for the help by the way!)…

    validation

    Thread Starter DerekKnox

    (@derekknox)

    And my RSS url now is shows the difference

    https://derekknox.com/lab/?feed=rss2

    You need to use https://feedvalidator.org/ for validating feeds (as opposed to web pages).

    I’d suggest that you customise the default index.php file in your theme rather than trying your current approach.

    I also noticed that you have unwanted artifacts from MS Word in your posts. Don’t paste content from Microsoft Word into WordPress as the pasted text will also contain Word’s own formatting. Sooner or later, this formatting will stop your pages from being displayed correctly (if at all) in Internet Explorer. If you cannot possibly manage without Word, paste your text into NotePad (or another text editor) first, then copy from NotePad into WordPress.

    Or use the inbuilt Paste from Word option in the Visual Editor. Or Windows LiveWriter.

    Thread Starter DerekKnox

    (@derekknox)

    WC3 Feed Validator does the same thing (for feeds as opposed to web pages). My issue is obviously that the feed has web page elements.

    I thought of possibly implementing that approach and may eventually resort to it. I am aware of Word pasting its formating, but was unaware that some of my posts contain this, I’m assuming they’re from older posts when I may have originally written the post in word. Thanks again for your help.

    WC3 Feed Validator does the same thing

    Oops! My bad! I got my validators confused.

    I am aware of Word pasting its formating, but was unaware that some of my posts contain this

    Try searching on “MSOnormal” (though I may have the casing wrong there). Spotted a couple of references when scanning the feed,

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Custom Index.php Invalidates RSS Feeds’ is closed to new replies.