WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. toni_romero
    Member
    Posted 1 year 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 11 months ago #

    I have the same questions! can anyone help?!

  3. Lester Chan
    Member
    Plugin Author

    Posted 11 months 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 11 months 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.