WordPress.org

Forums

The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

WP-ShowHide
[resolved] Move showHide link (4 posts)

  1. toni_romero
    Member
    Posted 3 years ago #

    Hello,

    I was wondering if there was a way to move the Show / Hide link to the bottom of the content instead of staying in the same place in the document.

    Thanks!

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

  2. lena_k198
    Member
    Posted 2 years ago #

    I have the same questions! can anyone help?!

  3. Lester Chan
    Member
    Plugin Author

    Posted 2 years ago #

    https://github.com/lesterchan/wp-showhide/blob/master/wp-showhide.php#L68

    Replace Line 68 With
    $output = '<div id="'.$type.'-content-'.$post_id.'" class="'.$type.'-content" style="'.$hidden_css.'">'.$content.'</div>';

    Replace Line 69 With
    $output .= '<div class="'.$type.'-link"><a href="#" onclick="showhide_toggle(\''.$type.'\', '.$post_id.', \''.esc_js($more_text).'\', \''.esc_js($less_text).'\'); return false;"><span id="'.$type.'-toggle-'.$post_id.'">'.$more_text.'</span></a></div>';

    UNTESTED

  4. lena_k198
    Member
    Posted 2 years ago #

    Thank you Lester. This works.

    Can you also help me to figure out how to put the link to be right in the paragraph. Right now it is floating in the middle of the page.
    I need it similar to where Read More triggers more text:

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut READ MORE

    Thanks!!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.