WordPress.org

Ready to get started?Download WordPress

Forums

Simple Footnotes
[resolved] Removing the space before note in post text (5 posts)

  1. oldmankit
    Member
    Posted 9 months ago #

    As was discussed in an old post, this plugin inserts a space before the superscript footnote link in the body of the text.

    Is there any way to remove it?

    http://wordpress.org/plugins/simple-footnotes/

  2. Grant Pax
    Member
    Posted 6 months ago #

    I'm similarly troubled. How do I get rid of the space?

  3. Grant Pax
    Member
    Posted 6 months ago #

    You'll have to edit the plugin. Change this (on the line that starts with return):

    function shortcode( $atts, $content = null ) {
                    global $id;
                    if ( null === $content )
                            return;
                    if ( ! isset( $this->footnotes[$id] ) )
                            $this->footnotes[$id] = array( 0 => false );
                    $this->footnotes[$id][] = $content;
                    $note = count( $this->footnotes[$id] ) - 1;
                    return ' <a class="simple-footnote" title="' . esc_attr( wp_strip_all_tags( $content ) ) . '" id="return-note-' . $id . '-' . $note . '" href="#note-' . $id . '-' . $note . '"><sup>' . $note . '</sup></a>';
            }

    to this:

    function shortcode( $atts, $content = null ) {
                    global $id;
                    if ( null === $content )
                            return;
                    if ( ! isset( $this->footnotes[$id] ) )
                            $this->footnotes[$id] = array( 0 => false );
                    $this->footnotes[$id][] = $content;
                    $note = count( $this->footnotes[$id] ) - 1;
                    return '<a class="simple-footnote" title="' . esc_attr( wp_strip_all_tags( $content ) ) . '" id="return-note-' . $id . '-' . $note . '" href="#note-' . $id . '-' . $note . '"><sup>' . $note . '</sup></a>';
            }

    Just remove the space before the opening of the <a> tag.

  4. oldmankit
    Member
    Posted 6 months ago #

    Thanks Grant for posting a solution. I will try that.

    It's a shame it's not baked into the plugin, as this means that every time we upgrade we'll have to edit this file.

  5. oldmankit
    Member
    Posted 6 months ago #

    Yes, this works. Thanks again!

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.