Forums

Add Link to Facebook
[resolved] Query Posts Conflict (16 posts)

  1. witchdoc
    Member
    Posted 1 year ago #

    I've found that this plugin is in conflict with my query posts callout on my template page? Initially it doesn't show up at all on the home sidebar (where php is called out AFTER the query posts and loop). But I find that when I cut out the query_posts callout or put the sidebar callout BERFOR the query posts and loop, then the plugin works properly. Strange. Perhaps I'm using query posts wrong? Here's the code currently:

    <div>
    <?php query_posts( 'cat=-1, cat=-12, cat=-15, cat=-11, cat=-13, cat=-14, cat=-16, cat=-17, cat=-10', 'posts_per_page=5' );?>
    <?php get_template_part( 'loop', 'index' ); ?>
    </div>
    <div>
    <?php dynamic_sidebar('sidebar-home'); ?>
    </div>

    Moving the sidebar container above the query/loop allows the plugin to work. Deleting the query posts call and keeping the sidebar callout below - the plugin works.

    Any help as to solving this problem would be much appreciated.

    Thanks much!
    WD

    http://wordpress.org/extend/plugins/add-link-to-facebook/

  2. Marcel Bokhorst
    Member
    Plugin Author

    Posted 1 year ago #

    See the FAQ, questions U34 or else C01/C02

  3. witchdoc
    Member
    Posted 1 year ago #

    Thanks Marcel - but not sure this helps much other than pointing out a conflict with query callouts. Not quite clear on how this can solve the issue?

  4. Marcel Bokhorst
    Member
    Plugin Author

    Posted 1 year ago #

    Try restoring the original post object, like in the example here.

  5. witchdoc
    Member
    Posted 1 year ago #

    If I knew what you meant, I would try it. Sorry for being such a noob, but I can't make heads or tails of the linked example. I appreciate your suggestion, truly. But I just don't understand enough php to execute.

  6. Marcel Bokhorst
    Member
    Plugin Author

    Posted 1 year ago #

    Just this:

    global $outerPost;
    
    ... your query code ...
    
    $post = $outerPost;
    setup_postdata($post);
  7. witchdoc
    Member
    Posted 1 year ago #

    global $outerPost;
    <?php query_posts( 'cat=-1, cat=-12, cat=-15, cat=-11, cat=-13, cat=-14, cat=-16, cat=-17, cat=-10' );?>
    $post = $outerPost;
    setup_postdata($post);

    Like so? Cuz this just doesnt' seem right.....? Crap, I wish I knew php more.

    Thanks much for efforts.

  8. Marcel Bokhorst
    Member
    Plugin Author

    Posted 1 year ago #

    Like this:

    <?php
    global $post;
    $post_save = $post;
    query_posts('cat=-1, cat=-12, cat=-15, cat=-11, cat=-13, cat=-14, cat=-16, cat=-17, cat=-10');
    $post = $post_save;
    setup_postdata($post);
    ?>
  9. witchdoc
    Member
    Posted 1 year ago #

    Thanks Marcel - really do appreciate it bud. But it just aint cuttin it. Seems like I've got deeper issues at work here. May have to forgo this or recode my sidebar. ugh. Was really hoping this would work.

    Again - thank you kindly.

    R

  10. witchdoc
    Member
    Posted 1 year ago #

    Ok - so I'm back. I've somewhat worked around the above issue. Except now the darn thing isn't showing up in my category template for some reason. Everywhere else just fine. The problem I'm having NOW is that the 'update link on facebook' box disappeared on me and my posts don't show up on FB. So I doubled checked the settings and didn't find anything different. Being that I recently made my WP site live (through moving the htacess and index file outside the WP directory and into my root folder. Have done on several occasions to bring a site live), this could be a culprit. So I took the liberty of re-creating another FB APP and re-plug in the AP ID and Secret along with the red URL as indicated. Now when I hit 'Authorize', it jumps to the apache directory page of my website?!?!? wth?!

    At this point, I'm just entirely confused. Again, any help would be REALLY appreciated as I've taken great pains in styling out my FB widget and don't want to reinstall the darn thing and lose my stylings.

    Thanks MUCH in advance.
    R

  11. Marcel Bokhorst
    Member
    Plugin Author

    Posted 1 year ago #

    Make your the WordPress address and site URL (WordPress general settings) are correct. The plugin derives the return URL from these settings. You can set these with constants too (with the advantage that you can simple undo it). Read here.

  12. witchdoc
    Member
    Posted 1 year ago #

    They are indeed correct. As the site fully functions. And changing the WP address is extremely dodgy in that you could lose access to your admin area all together and have to go through an extensive work-a-round. Essentially my WP core lives in a directory that my htaccess file (inside my root folder) points to. This is so my 'website.com' points directly to my WP directory. This is the easiest way for me to have a WP site linke to direct URL.

    Is this causing the issue? The red URL given with the plugin is exactly where my WP site lives.

  13. Marcel Bokhorst
    Member
    Plugin Author

    Posted 1 year ago #

    Send me the debug info as explained in the last question of the FAQ and I will see what I can find.

  14. witchdoc
    Member
    Posted 1 year ago #

    Great I sent the debug info- not sure if it sent or not? No confirmation message. Let me know if you don't get it.

    Thank very much for looking into this. I'm hoping we can find a solution.

    R

  15. Marcel Bokhorst
    Member
    Plugin Author

    Posted 1 year ago #

    I didn't receive the debug info, maybe PHP mail is not working correctly on your server. Was there an error message while sending it?

    I don't think this is a problem with the plugin, but with the way your server is configured. If the redirect URL is correct (the red URL), you should return on the plugin settings page after Facebook authorization.

  16. witchdoc
    Member
    Posted 1 year ago #

    Ok was my bad. I got a confirmation message. I had to input a valid forum topic link in field. I used the Link To Facebook Link. Wasn't sure if I were to use that one or this current thread?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic