Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #992284

    Hi to you all!

    I would like to insert a READ MORE tag in a text block. And I’ve found this code from Ismael:

    ————–
    Add something like this in the text block:

    This is a paragraph.
    <div class=”hide_this”>This is a paragraph hidden initially</div>
    Read more
    And then add this code in the functions.php file:

    add_action(‘wp_footer’, ‘ava_new_custom_script’);
    function ava_new_custom_script(){
    ?>
    <script type=”text/javascript”>
    (function($) {
    function j() {
    $(‘.show_button’).click(function() {
    $(‘.hide_this’).toggle();
    });
    }

    j();
    })(jQuery);
    </script>
    <?php
    }
    —–

    Which works ‘almost’ ;) It does it just the other way around. First the whole text is visible and when I click READ MORE it hides the paragraph.
    What am I missing?

    Please help!
    Kind regards
    capuchin

    #992291

    Hey capuchin,

    Thank you for using Enfold.

    The “hide_this” container should be hidden on page load. Use this css code.

    .hide_this { display: none; }
    

    Best regards,
    Ismael

    #992300

    Hello Ismael,

    Brilliant! Thank you for your quick response! It works.

    Kind regards
    capuchin

    #992481

    Hi Ismael

    Thanks for all your input so far!

    I tried to set it up on my client’s website and I see the Read More tag works but the page always jumps to the top…then you have to scroll
    down to the text again. Can you think of a solution for this please?

    Please see sample website.

    Kind regards
    capuchin

    #992691

    Hi,

    Glad it worked. :)

    Remove the href attribute of the read more text or replace it with a span tag.

    <span rel="nofollow">Read more</span>
    

    Best regards,
    Ismael

    #993839

    Hi Ismael!

    All good! Thx!
    You can close this…

    Kind regards
    capuchin

    #993917

    Hi,
    Glad Ismael could help, we will close this now. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Enfold read more tag in text block work around’ is closed to new replies.