WordPress.org

Ready to get started?Download WordPress

Forums

WP-Footnotes
Choose where to put footnotes on page (26 posts)

  1. turkeyphant
    Member
    Posted 3 years ago #

    Can't work out how to put the footnotes so they aren't the very last thing in the content area. Is there a shortcode to manually put the footnotes somewhere so you can have further content below them?

    http://wordpress.org/extend/plugins/wp-footnotes/

  2. huyz
    Member
    Posted 3 years ago #

    I agree that this is a problem because there are lots of other plugins that insert things at the end of the post but before the footnotes, such as social sharing buttons, or GD rating buttons.

  3. turkeyphant
    Member
    Posted 3 years ago #

    Does anyone have to knowhow to implement this quick fix?

  4. Chris Brennan
    Member
    Posted 3 years ago #

    Did you ever figure out a fix for this? I'm having the same issue.

  5. huyz
    Member
    Posted 3 years ago #

    There seems to be enough demand that I should take a look at the code.

  6. Chris Brennan
    Member
    Posted 3 years ago #

    Yeah, not just on this footnote plugin, but it seems to be a common request for other footnote plugins as well. It doesn't look like anyone has been able to deliver yet though.

  7. huyz
    Member
    Posted 3 years ago #

    Silly me, it's a simple fix: they already have an option called priority.
    Change the default 11 to 1, and you're set.

  8. turkeyphant
    Member
    Posted 3 years ago #

    Sorry but how does that help the issue?

  9. huyz
    Member
    Posted 3 years ago #

    @turkeyphant Sorry, I misread what you wrote. I guess you want to put the footnotes in the middle of the content? I just wanted the footnotes at the end of the content but before the other plugins.

    @Chris Brennan are you looking for the same thing as turkeyphant?

  10. turkeyphant
    Member
    Posted 3 years ago #

    @huyz - I wanted to position them at arbitrary positions within the content.

  11. Chris Brennan
    Member
    Posted 3 years ago #

    @huyz - Yes, I'm looking for the same thing as turkeyphant. I'm writing encyclopedic articles in which I want to put a bibliography after the endnotes, so I would like to be able to place the endnotes in other locations on the page. It seems like a shortcode would be the best way to accomplish this, although I'm not sure how to modify the plugin to accomplish this. It seems like a feature that users of other footnotes plugins are requesting as well, although so far no one has been able to deliver.

  12. huyz
    Member
    Posted 3 years ago #

    After some investigation, I don't think it would be very hard.

    1. Use a "fake" shortcode, i.e. one that you don't register
    2. add_filter("the_content", ...) in order to preg_replace the fake shortcode with the footnotes
    3. the footnotes are what comes out of the process() function
    4. If there is the shortcode, then don't output the footnotes in it usual place, i.e. below the content

    If there are no surprises, this is maybe 1-2 hours.

  13. turkeyphant
    Member
    Posted 3 years ago #

    Any news, huyz?

  14. huyz
    Member
    Posted 3 years ago #

    I was hoping someone else would do it, because I have so many other things on my plate. :)
    That's why I gave the above instructions.

    I guess you folks are waiting on me then.
    Ok, I'll see what I can do, then.

  15. huyz
    Member
    Posted 3 years ago #

    Ok, done. You can now use a [footnotes] shortcode anywhere on the page with my modifications.

    Check out: http://huyz.us/2011/wordpress-footnotes-anywhere-in-the-content/

  16. huyz
    Member
    Posted 3 years ago #

    @Chris Brennan
    Can you show me posts where others may have requested this feature? I'd like to notify them.

  17. huyz
    Member
    Posted 3 years ago #

    Submitted enhancement request to Trac: http://plugins.trac.wordpress.org/ticket/1345

  18. turkeyphant
    Member
    Posted 3 years ago #

    Beautiful! Seems to work perfectly - thanks so much. I've notified the author too.

  19. turkeyphant
    Member
    Posted 3 years ago #

    Ooops, spoke too soon. Doesn't play nice with the Text Replace plugin which uses codes like :wp: to replace with "WordPress".

    Also doesn't seem to remove the footnotes at the end of the page sometimes so you end up with the footnotes twice.

  20. huyz
    Member
    Posted 3 years ago #

    What happens with Text Replace?

    As for the double footnotes, I'm not very familiar with the order in which the content gets filtered and replaced. There are so many filters that take effect: WP's built-in ones, any shortcodes, and additional plugins such as ones that add sharing buttons. What surprised me when I coded it was that the footnotes were being appended to the end *before* the shortcodes were invoked. I found that unnatural. So there's probably something I don't understand about the order of filters.

    Without seeing your code, I can probably handle both cases: the shortcode gets processed before and the shortcode gets processed after the original plugin attempts to append the footnotes. So let me try that and update it.

  21. turkeyphant
    Member
    Posted 3 years ago #

    What happened for me is that using Text Replace within footnotes didn't work.

    1. The footnotes appeared where I put them but also at the end still.
    2. The first set of shortcode footnotes only had one text replacement work properly - the other didn't. The second set worked with all text replaces happening properly.

  22. huyz
    Member
    Posted 3 years ago #

    2. This is with the same plugin? In the internal set of footnotes, Text Replace replaced one shortcut but not another? That's odd.

    CORRECTED: I meant "the internal set of footnotes", not "plugins"

  23. huyz
    Member
    Posted 3 years ago #

    For wp-footnotes, what is the priority you have set in your options?

    And if Text Replace has the same option, what's the priority on that?

  24. turkeyphant
    Member
    Posted 3 years ago #

    2. This is the same conflict with Text Replace.

    e.g. in the first set of footnotes TR replaced all instances of :wp: with WordPress but left all instances of :pw: as :pw:. Weird I know.

    Footnotes priority is default - 11. TR doesn't have that option.

  25. huyz
    Member
    Posted 3 years ago #

    Ok fixed.

    I can't use the built-in shortcode mechanism -- that filter is stuck at priority 11.
    So in order to respect wp-footnotes' priority option, I had to replace shortcodes on my own, at the right priority.

    I couldn't replicate the half-conflict with Text Replace, but this update should fix that problem as well.

  26. turkeyphant
    Member
    Posted 3 years ago #

    That looks brilliant now - thanks again!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic