WordPress.org

Ready to get started?Download WordPress

Forums

URL Feed for Facebook error (8 posts)

  1. VoidHawk
    Member
    Posted 3 years ago #

    Recently set-up WordPress for blogging on my website and its up and running fine - no problems.

    Currently taking next step and setting up a Facebook business fan page and would like to incorporate the WordPress blog. Followed well publicised instructions to go through the Notes Tab to 'Import a Blog'. At section where they require the blog URL address I entered in the correct URL address but it failed with the message "We couldn't find a feed using the URL you provided". Read a lot of blogs about the format of this URL and tried a multitude of variations without success.

    Eventually ran a routine to output and verify the four available feed URL's and I was back were I started. I then typed in the feed URL's directly into a browser to see the results. They all failed but when I looked at the underlying source generated I could see that the correct XML code was generated but that the index.php routine had also been executed and the output code had been appended to the XML code which caused the feed request to fail.

    Validated the failure using the w3.org feed validation site

    http://validator.w3.org/feed/ using

    http://www.shoppingforireland.com/newsblog/?feed=rss2

    Any assistance would be appriciated.

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    Have you tried:

    - deactivating all plugins to see if this resolves the problem? If this works, re-activate the plugins one by one until you find the problematic plugin(s).

    - switching to the default theme to rule out any theme-specific problems?

  3. VoidHawk
    Member
    Posted 3 years ago #

    Thanks for your reply esmi.

    1) deactivating all plugins - no effect.

    2) switching to the default theme - resolved the problem but in turn has highlighted another issue as it forces me to remove the website look and feel from the blog page which is not what I want to do.

    If I just create an index.php file with the following code then the feed command works:-

    <?php
    session_start();
    define('WP_USE_THEMES', true);
    /** Loads the WordPress Environment and Template */
    require('./wp-blog-header.php');
    ?>

    However I have set the define('WP_USE_THEMES', false); so that I can define my own theme. To define my own theme I just continued to code the index.php file:-

    <?php
    session_start();
    define('WP_USE_THEMES', false);
    /** Loads the WordPress Environment and Template */
    require('./wp-blog-header.php');
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    .... etc etc

    This works perfectly when used with my website but causes the problem with the feed when I try to connect to the feed through my Facebook page.

    So now my question is am I wrong to extend the index.php to create my required look and feel - am I missing a switch to stop this happening or is there an alternative method? Am I really the first person who has created their own look and feel through this method and then tried and failed to add the blog to Facebook?

    Once again, any assistance would be appriciated.

  4. esmi
    Forum Moderator
    Posted 3 years ago #

  5. VoidHawk
    Member
    Posted 3 years ago #

    Thanks esmi.

    I have reviewed the Integrating_Wordpress_with_Your_Website document but there is nothing in this document to indicate that there is anything wrong with what I have done or any other method to code the integration.

    This problem centres on the index.php in the WordPress top level directory. In an attempt to resolve this problem I renamed the index.php to myblog.php and called myblog.php directly from my website. This worked and the page displayed correctly with the blog entries. I then created the index.php as:-

    <?php
    session_start();
    define('WP_USE_THEMES', true);
    /** Loads the WordPress Environment and Template */
    require('./wp-blog-header.php');
    ?>

    This would make the feed work correctly. This all worked ok until I selected any of the WordPress options that sre available from the myblog.php page. Example 'archives' coded as <?php wp_get_archives('type=monthly'); ?> produces a list of options and if I select one it then displayed the selected blog entry with the default WordPress theme using the URL http://www.shoppingforireland.com/newsblog/?p=61 - (obviously defaulting to the index.php to display the output). If I set the define('WP_USE_THEMES', false); in the index.php then selecting an option just gives me a blank screen.

    So back to square one - WordPress integrated with website and working exactly as expected. Just 'feed' not working as it outputs the correct XML followed by the index.php output appended to the feed file.

    Is there a way to configure the WordPress system to leave the default index.php in the high level directory so that the feed will work and then tell WordPress to run my custom programs in a lower level directory and ensure that the archive options etc will look to the lower level directory when selected.

    Once again, any assistance would be appriciated.

  6. esmi
    Forum Moderator
    Posted 3 years ago #

    I've not tried this with a site integration but I wonder if Giving_WordPress_Its_Own_Directory might be useful?

  7. VoidHawk
    Member
    Posted 3 years ago #

    Thanks esmi.

    WordPress has its own directory http://www.shoppingforireland.com/newsblog and the blog works from this sub-directory. The website was not developed using WordPress - its a standard HTML,CSS,JavaScript and PHP development with WordPress installed in the syb-directory to manage the Blog. No part of WordPress resides in the root directory.

  8. esmi
    Forum Moderator
    Posted 3 years ago #

    OK - just to recap: does the feed work correctly if you allow WP to use the default theme?

Topic Closed

This topic has been closed to new replies.

About this Topic