Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm a bit confused.

I have my own custom post type - products.

I'm listing all the products on page-products.php.

Every product has also it's own page - single-products.php.

And the big and strange thing is... I'm using more quicktag:

<!-- more -->

And it doesn't work on both single-products and page-products! I don't care about single page, but I'd love to use on the page-products listing. And I'm not able to.

Documentation says:

The MORE quicktag will not operate and is ignored in Templates, such as single.php, where just one post is displayed.

http://codex.wordpress.org/Function_Reference/the_content

So is it perfectly normal to not work for me in both cases? As far as I understand it should work in the first case... Is there a way to force more quicktag to display there?

And yes, in both cases more "produces" perfect more span... But even content after the span is being shown...

Thank you!

share|improve this question
add comment

3 Answers

up vote 0 down vote accepted

The "read more" link is essentially a navigational device meant to point visitors to a full version of a piece of some excerpted content. A single.php of any post type is the full version, therefore it is 100% in the nature of <!-- more --> to not appear on single custom post type pages.

If you're just looking to display a snippit of your content, check out the_excerpt().

share|improve this answer
    
That's a HUGE mistake, especially when you have page-custom.php and single-custom.php and lots of post in there... I'm using both excerpts and contents but in this particular case I need the_content. BADLY :( –  Wordpressor Feb 11 '11 at 0:49
    
My apologies. I guess I don't understand the question then. –  editor Feb 11 '11 at 1:44
add comment

Try this:

global $more;    // Declare global $more (before the loop).
$more = 0;       // Set (inside the loop) to display content above the more tag.
the_content("More...");

share|improve this answer
    
That's extremely helpful, thanks so muych for sharing... That just saved my countless hours of pulling out my remaining hair! –  user3959 Mar 15 '11 at 16:26
    
Excellent, glad it helped. –  Pippin Mar 20 '11 at 23:51
add comment

All we have to go on is <!-- more -->. If that's what you are actually doing, try this from the docs:

Note about <!--more--> :

  • No whitespaces are allowed before the "more" in the <!--more--> quicktag. In other words <!-- more --> will not work!
  • The quicktag will not operate and is ignored in Templates, such as single.php, where just one post is displayed.
  • Read Customizing the Read More for more details.

(Ooops. I just noticed the <!-- got swallowed by the formatter.)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.