• Hi

    I’m trying to crop the content within the repeater template, like so:

    <?php substr(strip_tags(the_content()), 0, 93) . '...'; ?>

    However it isn’t working as expected, instead is loading the full content. Is there a reason the plugin isn’t processing php functions or is there something I’m missing?

    Thanks

    Alan

    https://ww.wp.xz.cn/plugins/ajax-load-more/

Viewing 1 replies (of 1 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    Solved offline with the following code.

    <?php
      global $post;
      echo substr(strip_tags(get_post_field('post_content', $post->ID)), 0, 93) . '...'); 
    ?>
Viewing 1 replies (of 1 total)

The topic ‘PHP within repeater template’ is closed to new replies.