• <p><?php the_content(”); ?>… read more ></p>

    Can anyone help me fix that code. I would like to trim the content to certain amount of words. Then, whenever someone click the readmore, it will brings me to another page which shows the whole content.

    any advise ?

    it’s for this page

    I am using post to post the content, I do not know what I would name the page that shows the whole content.

Viewing 15 replies - 1 through 15 (of 19 total)
  • Thread Starter davy_yg

    (@davy_yg)

    Additional information:

    <p><?php the_content(''); ?>... <a href="lorem-ipsum-8/">read more ></a></p>

    Is there any way to place the post page-name or title in the href ? page-name is better I think, so whenever people click the a href it will expand the post content.

    This tells you everything you need to know about read more.

    Thread Starter davy_yg

    (@davy_yg)

    I’ve tried adding this: <?php the_content(‘Read more…’); ?>

    and it still does not show me the read more. and also where to place the link name ?

    Thanks.

    Just to make sure we are on the same page, are you expecting the ‘read more’ to show on the single post page? Because it won’t – it only shows on pages that show multiple posts, like a listing of all your latest posts, or a category page.

    When you create a post you can insert a <–more–> link so that when that post shows on a category or archive page, you only see the text above the more link. But when you visit the post itself you see all of the text, unless you are using a pagination plugin.

    Thread Starter davy_yg

    (@davy_yg)

    Yea, it’s for this page: Page News

    Is this the correct syntax to show the read more next to content ? <?php the_content(‘Read more…’); ?>

    First, I still do not see the read more. Second, where to place the link address ?

    Are you using the code inside The Loop? It will only work there, reason I ask is that your content appears to be static, as though you hand-crafted the page rather than let WordPress show the posts thru a standard loop query. You have to use The Loop.

    Once you have it inside the loop, the_content gets the id of the post and converts it to a hyperlink, then shows the default ‘more’ text unless you override it inside the parens. So,

    <?php the_content(); ?> results in (more…)
    <?php the_content("Read more"); ?> results in Read more
    <?php the_content("Continue reading " . the_title('', '', false)); ?> results in “Continue reading ACTUAL POST TITLE”

    Are you adding a <!--more--> link somewhere within your Post Content?

    Thread Starter davy_yg

    (@davy_yg)

    Yes, I do have loop:
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>

    <p><?php the_content(“Read more…”); </p>
    <?php endwhile; ?>

    The read more does not display correctly.

    About – News

    Are you adding a <!--more--> link somewhere within your Post Content?

    Thread Starter davy_yg

    (@davy_yg)

    Hmm.. nope. I do not see any of that sign. What is it for by the way ?

    Hmm.. nope. I do not see any of that sign. What is it for by the way ?

    That is the comment that you have to add to your Post Content, in order to invoke the “read more” link.

    Thread Starter davy_yg

    (@davy_yg)

    ok, I’ll try this:

    <!–more–>
    <p><?php the_content(“Read more…”); ?></p>

    and it still does not show me the read more.

    <!–more–> needs to go into the actual post content when you write the blog post.

    It does not go in the php template file.

    In your html Post editor there is a more button, click that when the cursor is where you want the link.

    ok, I’ll try this:

    <!--more-->
    <p><?php the_content("Read more..."); ?></p>

    and it still does not show me the read more.

    That’s your template file. You need to put the <!--more--> tag in your actual Post Content.

    For example:

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce auctor sollicitudin lacus vel condimentum. Vivamus vitae lectus venenatis sapien auctor commodo. Fusce vel purus tellus. Donec porta porta eros quis aliquet. Sed a sagittis odio. Proin fringilla gravida urna, et rutrum dolor blandit euismod. Donec tincidunt justo sed est consectetur hendrerit. Proin ut imperdiet velit. Cras mollis nunc et nulla imperdiet nec mollis urna lobortis.

    <!--more-->

    Nullam ut lacus vitae arcu condimentum sollicitudin ac ac eros. Quisque accumsan auctor erat, eget venenatis nisl lacinia id. Suspendisse eget magna turpis. Aenean rhoncus, mauris nec ullamcorper bibendum, ligula diam blandit diam, vel rhoncus purus sapien non mi. Aenean a convallis arcu. Phasellus non est mollis eros lobortis vestibulum consequat ac arcu. Fusce justo urna, ultrices ut varius a, eleifend ac justo. Sed ornare rhoncus turpis sed accumsan. Curabitur dignissim, justo id facilisis elementum, mauris orci convallis augue, non scelerisque lacus dolor et lorem. In hac habitasse platea dictumst. Phasellus laoreet imperdiet odio, ac tristique sem dictum et. Proin mattis, eros in dignissim dignissim, nibh tortor congue nibh, at lacinia erat elit vitae diam.

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘content’ is closed to new replies.