• Hi!

    I try to show featured posts in my homepage, with this code:

    <?php
    	global $post;
    	$kiemelt = get_posts('numberposts=1&tag=featured');
    	foreach($kiemelt as $post) :
    	setup_postdata($post);
    	?>
    		<h3><?php the_title(); ?></h3>
    		<?php the_content('More...'>
    	<?php endforeach; ?>

    But my all content is there, and no visible More… link anywhere. The generated page source is here:

    <h3>Próba bejegyzés</h3>
    <p>Sz?veg</p>
    <p><span id="more-29"></span></p>
    <p>Még sz?veg</p>

    Whats the problem?

Viewing 14 replies - 1 through 14 (of 14 total)
  • `replace
    <?php the_content('More...'>
    with
    <?php the_excerpt(); ?>

    Thread Starter Viszt Péter

    (@passatgt)

    Sadly doesn’t help, still showing the full text of the post, just only wrap with one paragraph:

    <h3>Próba bejegyzés</h3>
    <p>Sz?veg Még sz?veg</p>

    Have you defined a manual excerpt or placed the more tag in your posts?

    Thread Starter Viszt Péter

    (@passatgt)

    Yes, now i defened the excerpt, its working, but not a great solution, i just want the more.. link to my post. I set the excerpt to 20 word, but sometimes my post headline is more than 20 word, so its not a great solution for me:(

    I didn’t placed the more tag in my posts

    instead of:

    <?php the_content('More...'>

    try this:

    <?php the_content('More...')>

    Yeah setting a word limit isn’t really ideal.

    If you don’t want to define a manual excerpt or have a fixed length excerpt the only solution I know of is the more tag:
    see https://en.support.wordpress.com/splitting-content/more-tag/

    Basically wherever you put the more tag in each post is where the post will be displayed up until.

    Thread Starter Viszt Péter

    (@passatgt)

    Mauseherz: Not working too, i think i just copied the code wrong in here.

    Richard Lyon: I use the more-tag, and the problem is, its not working:)
    I put this tag every post that i have, but its still display the full text of the post.

    <h3>Próba bejegyzés</h3>
    <p>Sz?veg</p>
    <p><span id="more-29"></span></p>  --> this is the more tag, but its not a link, and the content after is still displaying
    <p>Még sz?veg</p>

    When using the more tag are you using <?php the_content('More...'); ?>
    As I don’t think it works with the_excerpt();

    Besides that I am not sure what the problem could be.

    Thread Starter Viszt Péter

    (@passatgt)

    Yes, i am using the_content, without any luck

    <?php the_content('More...'); ?>

    sry, of course this would be the right code… (i forgot the ; and the ?) thx richard

    I’m having the same or similar problem, although in my case I do have correct syntax. The code:

    $events = get_posts( "posts_per_page=2&orderby=date&order=DESC&post_type=post&category_name=" . $category_name);
    if ( count( $events ) != 0 )
    {
    	$post = $events[ 0 ];
    	setup_postdata( $post );
    	$category_link = get_category_link( get_cat_id( $category_name ) );
    	the_content( "Continue reading ..." );
    	?><a href="<?php echo $category_link; ?>" title="Link to <?php echo $category_name; ?>"><em><?php echo $category_caption; ?></em></a><?php
    }

    When I call the_content() I expected the post content to be cut-off at the more section and have a “Continue reading …” link. However, I get the full post, like everything. Is there something I’m doing wrong?
    This code is written in a widget’s widget() function.

    I seem to have fixed the problem by doing the following:

    global $more;
    $more = 0;
    the_content( "Continue reading ..." );

    I am also having trouble with a “Read More” button and link on my https://www.backstreetprintin.info/wordpress site. I am new to WordPress and have never posted in WordPress support before. I am trying to change a category title from “Tech” to “Upcoming Events” but now the “Read More” button link doesn’t go anywhere.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Read more is not working’ is closed to new replies.