Show/Hide entry content

Community Forums Forums General Discussion Show/Hide entry content

This topic is: not resolved

This topic contains 1 reply, has 2 voices, and was last updated by  SoZo 2 years, 10 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #14072


    Hello All.

    I am currently using jquery.expander.js to hide/show paragraph content. I am working in wordpress 3.5 and genesis theme 1.9.1

    – The question is: When one of our marketers adds content to a page they will do this in the entry content window for that page, how can I edit my php so that it will somehow place a div of <div class=”expander”> around the entry content. Sample code below for div and class name it needs for the script to work.

    <div class=”expander”>

    <h1>Welcome and Thanks</h1>

    <p>Aliquam aliquet, est a ullamcorper condimentum, tellus nulla fringilla elit, a iaculis nulla turpis sed wisi. Fusce volutpat. Etiam sodales ante id nunc. Proin ornare dignissim lacus. Nunc porttitor nunc a sem. Sed sollicitudin velit eu magna. Aliquam erat volutpat. Vivamus ornare est non wisi. Proin vel quam. Vivamus egestas. Nunc tempor diam vehicula mauris. Nullam sapien eros, facilisis vel, eleifend non, auctor dapibus, pede.</p>


    Thanks so much.



    You need to add the div opening and closing tags in two separate functions with the appropriate priority numbers, e.g.

    add_action(genesis_post_content, open_tag, 5);
    function open_tag() {
    echo ”;

    add_action(genesis_post_content, open_tag, 1);
    function open_tag() {
    echo ”;

    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.