• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2784

Original Genesis Tutorials & 6000+ Guaranteed Code

Snippets

  • Consultation
  • Full Access
  • Log in

Toggle Full Content On Archives Only When Content Contains More Than 1 Paragraph

The code in this tutorial extends the code in this tutorial which enables you to dynamically add a read more / read less button to archive pages. The button enables you to toggle the full content on archive pages using both slideDown & slideUp jQuery functions.

The difference is, the code in this tutorial only adds the button when the post contains 1 or more paragraphs ( at least 2 ).

Here’s the demo which shows you exactly what the code does on the front page of the Genesis Sample child theme.

Video Demo

The demo shows how the button is only added when the post contains 2 or more entries. In this example, the 1st and last 2 posts only contain 1 paragraph so the toggle button is not needed therefore not added.

Customization

You can with or without membership support :

  • Use this solution on any archive type including author, blog, category, search, tag, custom post type or custom taxonomy type pages.
  • Use your themes default button styling.
  • Modify the Read More and Read Less button text.
  • Only add the toggle button after any number of paragraphs.
  • Change the speed and animation of both the slide down and slide up toggle effect.

Login or join to access the following code for members :

Register for full access

Related Tutorials

  • Toggle Read More Button To Show Full Content On Single Posts
  • Toggle Read More Excerpts To Show Full Content On Genesis Archives

Accordion & Toggle

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags