Support » Plugin: Easy Footnotes » Footnotes heading and footnotes placement

  • Hi,

    I tried out the plugin today and I like the pretty mouse-over display. But I ran into two issues:

    Footnote heading:

    The footnote heading (e.g. “Footnotes”) is always displayed, even if there is not a single footnote in the post.

    Footnote placement:

    Currently I’m using the Related Posts Jetpack module and, on some posts, I have additionally a custom “Go to Next Article in the Series” link. Of course the footnotes should be placed before these links. While I succeeded moving the footnotes before the Jetpack Related Posts by setting the priority to 20 (instead of the default 999) I didn’t find a way to bring them before my custom “Next…” link.

    Is there any way to achieve this?

    Probably the most flexible solution would be a second shortcode “[place footnotes here]”. Or let’s say, a combination of the two: 1) If no “[place footnotes here]” shortcode is found, the plugin places the footnotes at the very end (as it does now) and 2) if the shortcode is found it places the footnotes there where the shortcode is.

    Just a thought …

    Tom

    https://wordpress.org/plugins/easy-footnotes/

Viewing 15 replies - 1 through 15 (of 15 total)
  • PS:

    To answer my own question, in the meantime I could achieve it by simply commenting the add_filter('the_content' … 999); stuff and adding a new shortcode instead

    add_shortcode( 'placenotes', array($this, 'easy_footnote_after_content') );

    It seems to work fine now. It places the footnotes at the [placenotes] location and, as a side effect, the problem with the orphaned heading is also solved.

    Plugin Author Jason Yingling

    (@yingling017)

    Thanks for the heads up on the title. I’ve pushed an update in 1.0.7 to fix it from showing on those pages that don’t have any footnotes. I also switched the priority so it will show above the Jetpack related posts. I’d been meaning to do that, but my site has had an issue with Jetpack’s related posts and stopped showing so I forgot about it.

    I’ll have to look into adding a short code for note placement. I don’t want to make things get too hard to set up, but I might be able to look into a solution where if the shortcode is used on a page it skips appending it to the content.

    In the meantime, what are you using for your next and previous links? Are they being entered through another plugin or a custom function? Sounds like they must be being appended to the content if they’re showing before the footnotes.

    Thanks for having considered my proposals.

    what are you using for your next and previous links?

    ATM these are just divs with some associated CSS, entered via shortcode. That means, even with a priority of 20 for easyfootnotes, they will always be between the text body and easyfootnotes. But probably I could add these links also via content filter and custom priority – in the future (I’m just starting to learn WP/PHP…).

    But there are other “complications” regarding the placement: I have some more standardized footer elements, a “Sources, Credits, More Info” and sometimes a “Changes” (change notes for scripts, apps). The best footnote position depends on the length of these elements and of the footnotes. For example if there are 30 lines of change notes and a single line of footnotes, it’s more appropriate to place the footnotes before the change notes, and viceversa (from a reading-pragmatic perspective; personal opinion).

    That’s why I think that the described “[placenotes]”-type shortcode is the ideal solution to guarantee some flexibility. As already mentioned, this could be a completely “silent” option, that is, in absence of the shortcode the footnotes will be placed simply at the end. So, the “non-technical” user won’t get bothered by additional settings challenges.

    [There are some other things that make it impossible (for me) to use the plugin right “out of the box”, without modifications. But since this is not directly related to the placement question I think I’ll better open another thread.]

    I also switched the priority so it will show above the Jetpack related posts. I’d been meaning to do that, but my site has had an issue with Jetpack’s related posts and stopped showing so I forgot about it.

    I’ve noticed that a priority of 20 is fine for the Related Posts links, but still too less for Jetpack’s Sharing buttons (Twitter, Mail, etc.). They get inbetween.

    I’ve set it to 18, but it seems that anything between 11 and 19 is OK.

    It is a wonderful plugin, but I, too, have a need to place my footnotes above some other page content and for all my readiness to tinker haven’t yet managed it.

    @ecdltf I definitely occupy the more “non-technical” side of the spectrum and can’t seem to get your suggested shortcode to work… any tips?

    Much thanks to all.

    can’t seem to get your suggested shortcode to work… any tips?

    It’s simple, because the function is already there, you just have to add the shortcode:

    1. Open the file easy-footnotes.php which is in the directory /wp-content/plugins/easy-footnotes/. (Open it with a text editor, for example TextMate or TextWrangler, or Notepad++ if you’re on Windows; do not open it with MS-Word or such.)
    2. Comment the line add_filter('the_content', array($this, 'easy_footnote_after_content'), 20); which is around line 43. A valid comment prefix is//
    3. After the commented line add the line add_shortcode( 'placenotes', array($this, 'easy_footnote_after_content') ); where placenotes is the desired name of the shortcode.
    4. Save the file easy-footnotes.php
    5. Add the shortcode in your articles to make the footnotes appear there. (Reload page, empty cache if necessary.)

    It doesn’t matter which name you choose for the shortcode, as long as it is not reserved.

    However, in case the author of the plugin is already working on an implementation of the feature, it would be nice if he would tell us how his future shortcode will be named, so we won’t have to edit our articles again;-)

    Please note that when you make the changes as described above you have to place your shortcode in the article, otherwise the footnotes will not be visible. (i.e. placing the shortcode is not optional; an optional shortcode requires some more changes.)

    If you only want to change the placement of the footnotes relative to some other elements which are placed by other plugins, it is sufficient to change the priority in line 43. For example, as mentioned in the post above, set it to 18 if you want the footnotes to appear above Jetpack’s Share buttons.

    ecdltf, I can’t tell you how happy you’ve made me! It is so decent of you to take the time to explain this to me and your instructions worked perfectly. Much, much thanks!

    And, of course, my thanks again to the author, too.

    Plugin Author Jason Yingling

    (@yingling017)

    Great work! I am working on implementing this feature in an update. I’ll try to work with what you’ve got so I don’t cause any issues with what you’ve been doing in posts. Thanks for the support.

    Would be great if you could make the usage of the shortcode optional. As mentioned, in my hack it is obligatory. It would be better like this:

    1. If the shortcode is present the footnotes will be placed there
    2. If no shortcode is in the body the footnotes will be placed according to the priority set in line 43

    This way we could work without shortcode for the bulk of normal pages, and place the shortcode only when necessary, for the more special pages.

    By the way: Why not making the priority setting accessible via the GUI? As we’ve seen this already gives quite some flexibility if you have elements from other plugins in the bottom zone of the article (18 for the Share buttons, 20 for the Related Posts, …)

    Thanks for the very nice plugin!

    Tom

    Dear ecdltf,

    I would like to achieve the same goal and tried adding your code modification on the editing window of the file in question through the Bluehost file manager, but it is not working – nothing new happens.

    The addition of the code makes the line 43 looks as such:

    add_filter(‘the_content’, array($this, ‘easy_footnote_after_content’), 20);// add_shortcode( ‘placenotes’, array($this, ‘easy_footnote_after_content’) );

    Is that correct?

    I also tried and removed the cache of the last 1 hour, but again, no change.

    Thank you,

    Samuel

    tried adding your code modification on the editing window of the file in question through the Bluehost file manager

    I don’t know that file manager. Just launch your FTP client and go to the file in your site’s directory and edit it with a text editor (or with the integrated editor of your FTP client).
    OR download the plugin from here (not via WP), edit the file on disk and then upload the Easy Footnote plugin folder (with the edited file) to your site via FTP, replacing the existing Easy Footnotes folder.

    The exact location of the EF folder is wp-content/plugins/easy-footnotes

    add_filter(‘the_content’, array($this, ‘easy_footnote_after_content’), 20);// add_shortcode( ‘placenotes’, array($this, ‘easy_footnote_after_content’) );

    Is that correct?

    No, you’ve commented (//) the wrong line. These lines should look like this:

    // add_filter('the_content', array($this, 'easy_footnote_after_content'), 20);
    add_shortcode( 'placenotes', array($this, 'easy_footnote_after_content') );

    If you copy-paste the two lines from here it should work. (And, they are two lines, not one 😉

    PS: Instead of commenting (//) the first line you can delete it as well. I just said “comment” because it makes it easier to go back to the original state.

    Yay! Super thanks for the fast response. It’s working! Thank you!

    thanks you for this

    // add_filter(‘the_content’, array($this, ‘easy_footnote_after_content’), 20);

    cause the bubble pop up is already sufficient for my needs

    cause the bubble pop up is already sufficient for my needs

    Not so nice for someone who saves the page as PDF, or prints it to paper 😉

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Footnotes heading and footnotes placement’ is closed to new replies.