• Resolved Alex Cicovic

    (@acicovic)


    Hello there,

    I am using as reference the page https://webnus.net/dox/modern-events-calendar/overriding-mec-single-event-page/

    Here is some code:

    the_title();
    the_excerpt();
    the_content(); // Doesn't work

    The first two functions work normally, but when I call the_content() function I get the following error:

    Warning: count(): Parameter must be an array or an object that implements Countable in wp-includes/post-template.php on line 317

    However, doing this works:

    $content = get_post_field( 'post_content', get_the_ID() );
    echo do_shortcode( $content );

    This doesn’t make sense to me. Is this expected behavior?
    I’m using PHP 7.4

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘the_content() function not working for single event’ is closed to new replies.