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've created my own custom post type using this tutorial: http://thinkvitamin.com/code/create-your-first-wordpress-custom-post-type/

Everything works fine, but I'm having major problem with "Read more" feature.

As we all know <!--more--> adds <span id="more-[number]" /> at the start of hidden more paragraph. In my case this span breaks whole markup.

See for yourself:

    <p>This is normal paragraph and should be visible everywhere.</p>

    <!-- everything below is available only after clicking "Read more..." button -->

    <p><span id="more-[postnumber] />This is read "more" paragraph that will be displayed only on a "single" page.</p>
    <p>And another "more" paragraph.</p>

In my case it creates this strange code:

  <p>This is normal paragraph and should be visible everywhere.<br/>
  <span id="more-[postnumber] /></br>This is read "more" paragraph that will be displayed only on a "single" page.</p>
  <p>And another "more" paragraph.</p>

So the more feature in my case doesn't even work and doesn't even display "Read more" button.

Any ideas?

[EDITED]

Ok, so I've added whitespace after and before my <!--more--> tag, so the post looks like this in admin panel now:

This is normal paragraph and should be visible everywhere.

<!--more-->

This is read "more" paragraph that will be displayed only on a "single" page.

And another "more" paragraph.

And it outputs the whole text because more span is getting an additional paragraph (why? :O):

<p>This is normal paragraph and should be visible everywhere.</p>
<p><span id="more-[postnumber] /></p> <!-- I believe it shouldn't be in the additional <p> tag and that's the point -->
<p>This is read "more" paragraph that will be displayed only on a "single" page.</p>
<p>And another "more" paragraph.</p>

And about "more button" - I'm using the_content unfortunately...

And nothing helps, when I type 'TRUE' as the second parameter - the_content('Read more...', TRUE); - it hides everything BEFORE more tag (so it shows two last paragraphs and hides the first one).

What's that? :O

share|improve this question
    
For the record more span is supposed to be in separate p tag. That is intended and normal. When you say hides do you meant stuff disappears from page source? Could this be CSS issue? –  Rarst Dec 8 '10 at 18:24
    
Nope, it's not. I've checked plenty of custom themes with custom post names and I noticed that EVERY SINGLE one is using the_excerpt() function instead of the_content. So I've decided to switch and add an a href with permalink below. And it works. I believe there's something wrong with Wordpress. –  Wordpressor Dec 8 '10 at 19:15

2 Answers 2

up vote 1 down vote accepted

The 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

share|improve this answer

So, two separate issues - links not displaying and faulty markup?

For links not displaying - check if your template uses the_content() function, more functionality doesn't display links after the_excerpt().

For markup I find that you need blank lines around more for everything to work properly.

So this can cause markup issues:

Some text here.
<!--more-->
And more here.

But this works fine:

Some text here.

<!--more-->

And more here.
share|improve this answer
    
Nothing works. Thanks for trying. I'm going to update the first post and explain what I've already tried... –  Wordpressor Dec 8 '10 at 17:48

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.