Skip Navigation

[Resolved] Split: How to show a "Read more…" link when showing lists of posts…

This support ticket is created 6 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Author
Posts
#1095037

problem 6: I would like to have a read more button after a few lines of text so the reader then can read the story..

hidden link

#1095039

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

You need the <!-- more --> tag, which is a built-in WordPress feature.

You insert that comment in the post content itself where you want the Read more... link to appear.

There are lots of online articles describing this, here is an old one which seems still relevant: hidden link

#1096373

Hi nigel,

I tried to make this work

I need this to work for this page for example.
hidden link

After 150 charathers the text READ MORE

Use the layout ''orgineel'' and on the 3th row there is the text.
can you help me with this?'

var $j = jQuery.noConflict();
$j('.reviewtekst').each(function() {
var $pTag = $j(this).find('p');
if($pTag.text().length > 150){
var shortText = $pTag.text();
shortText = shortText.substring(0, 150);
$pTag.addClass('fullArticle').hide();
$pTag.append('Lees minder');
$j(this).append('<p class="preview">'+shortText+'</p><div class="curtain-shadow"></div>Read more');
}
});

$j(document).on('click', '.read-more-link', function () {
$j(this).hide().parent().find('.preview').slideUp().prev().slideDown();
});

$j(document).on('click', '.read-less-link', function () {
$j(this).parent().slideUp().next().show();
$j(this).parents('.reviewtekst').find('.read-more-link').slideDown(300);
});

Thank you

Ramon K

#1096860

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Ramon

The WordPress <!-- more --> tag only works on archive pages, e.g. the blog page, so that only a part of the post is shown when viewing a list of posts, it isn't intended to work on individual posts or pages, where the full content is shown.

You want that the post content is partly hidden even when a user visits the individual post?

That's not something that is supported by WordPress or Toolset, you will need a custom solution for that.

Sorry, but debugging custom code is outside our support policy. It is not an issue that is particular to Toolset so you could ask for help at Stack Overflow (wordpress.stackexchange.com).

I visited your linked page and checked the browser console it seems you have a syntax error in your code from an unexpected '<', so before anything else I would carefully read over your code and see if you can spot the error.

#1096921

Tnx