0

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!

3 Answers 3

0

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().

2
  • 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 :( Commented Feb 11, 2011 at 0:49
  • My apologies. I guess I don't understand the question then.
    – editor
    Commented Feb 11, 2011 at 1:44
2

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...");

2
  • That's extremely helpful, thanks so muych for sharing... That just saved my countless hours of pulling out my remaining hair!
    – user3959
    Commented Mar 15, 2011 at 16:26
  • Excellent, glad it helped.
    – Pippin
    Commented Mar 20, 2011 at 23:51
1

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.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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