Forums

[Plugin: WPBook] Permalink in header and footer doesn't work. (5 posts)

  1. bigredsign
    Member
    Posted 2 months ago #

    Hi,
    I just have a simple question. Is permalink still an available option for the header and footer? When I put it in either it just comes up as %permalink% instead of actually displaying the permalink. So I looked around int eh config.php before posting this and it looks like all the other options are defined except for permalink.

    I apologize in advance if there was already a post about this. I searched through the forums a bunch but didn't find any reference to my problem.

    I love the plugin. It really works great and has a simple install.

    http://wordpress.org/extend/plugins/wpbook/

  2. voyagerfan5761
    Member
    Posted 2 weeks ago #

    I see that it still doesn't work. I'm going to poke around in the code and see if I can add the functionality.

  3. voyagerfan5761
    Member
    Posted 2 weeks ago #

    Huh. Looks like there's no good WordPress function that will return a clean URL that points to the original post on the original site (not a broken apps.facebook.com link). The code that displays the link to source if that option is set is very convoluted and doesn't port well to a utility function (issues with variable scope).

    I'd spend more time on this, but I'm running low on that commodity. I suggest that the author store the return of that section of /theme/index.php into a variable, or just set it near the top of /theme/config.php, and then it'll be available wherever it's needed.

  4. BandonRandon
    Member
    Posted 3 days ago #

    Thanks guys looks like I over looked this when I was writing the header and footer code. This will be fixed in the next release and I'll post the correct code here (should be one line or so.)

    @voyagerfan, WPBook re-writes the permalink url to the url with the Facebook app prefix. There is a function inside of theme/index.php which will return the url outside of Facebook (it's being used for the "View original post button). However, for the permalink in the footer it should link inside of Facebook as to not confuse the user.

    Sorry for the inconvenience I'll take a look at this now and hopefully have a fix by this afternoon.

  5. BandonRandon
    Member
    Posted 3 days ago #

    here is the code to make permalinks work, in theme/config.php Add the following lines of code to lines 84-85 and 125-126

    $get_permalink = get_permalink();
     $permalink="<a href='$get_permalink'>permalink</a>";

    then add this to line 118

    $custom_template_header = str_replace("%permalink%", "$permalink", "$custom_template_header");

    and this to line 164

    $custom_template_footer = str_replace("%permalink%", "$permalink", "$custom_template_footer");

    This should fix the permalink problem, if you aren't comfortable writing code you can just wait till the next release.

Reply

You must log in to post.

About this Topic

Tags