Thread: Separate "Read more" from "php the_content"
Started 1 month, 1 week ago by ghaib
Hi, I'm doing a theme where the text (eg. content) is wrapped in a div with a bg color.
I'd like to separate the "Read more" button in a new div below, is that possible? To separate "Read more" from the standard php the_content line:
<?php the_content('Read more »'); ?>
Thanks!
I don't have a link at the moment, just doing some testing and research.
Basically, is there a php string in WP to call the "read more button", which is separated from the get_content string?
E.g. this:
<?php the_content('Read more »'); ?>
Becomes:
<?php the_content(); ?> and this <?php ('Read more »'); ?>
@kiano.ro: I posted the code, I'm basically looking to separate the two, there isn't more to it, it's not theme specific.
Is there a code which resembles <?php ('Read more »'); ?> (without the "get_content" part)?
If you're trying to end the content DIV and start a new one, then you could use..
<?php the_content('</div><div>Read more »'); ?>
The first closing DIV will close the current DIV (the one the content is in i assume), then open a new, which would be closed by the contents regular closing tag..
So rather then having..
<div>
some content
<div> more </div>
</div>
you'd end up ...
@t31os_
Yep, that's exactly what I mean. I solved it partially by doing this:
<?php the_content(''); ?>
And then this, in a separate div:
<a href="<?php the_permalink(); ?>">Read more</a>
However, a new problem emerges: the "Read more" button will always be present, linking to the post, whether <!--more--> is specified in the post or not.
To add to the above, the reasoning for using $post->post_content over get_the_content is simple. With get_the_content, the data has already had the shortcodes processed, therefore <!--more--> will not exist, the same does not ring true for $post->post_content . ghaib please mark your thread as resolved if the information supplied was sufficient.
jrav001 nearly had it but use span with display:block; not div otherwise code will not validate ;)... PHP: <?php the_content('<span class="more">Read More &raquo; </span>'); ?> CSS: .more { display:block; margin-top:10px; text-align:right; }
Nice new add-on feature for ! KDE - weather... Nice new add-on feature for ! KDE - weather wallpaper plugin http://www.kde-look.org/content/show.php?action=content&content=102185
Published
about a month ago
From
web
This is a nice theme:... This is a nice theme: http://www.gnome-look.org/content/show.php/StyGre?content=102302&PHPSESSID=df09e7ee8f43beeec45d97e06ff5a103
Published
about 7 days ago
From
xmpp
Another gr8 plasmoid for ! kde Lastmoid... Another gr8 plasmoid for ! kde Lastmoid http://www.kde-look.org/content/show.php/Lastmoid?content=98117
Published
about a month ago
From
web
Thread profile page for "Separate "Read more" from "php the_content"" on http://wordpress.org.
This report page is a snippet summary view from a single thread "Separate "Read more" from "php the_content"", located on the Message Board at http://wordpress.org.
This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity