WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Cant get the content.

[Resolved] Cant get the content.

  • <?php $myposts = get_posts(array(‘post_type’ => ‘banners’)); ?>

    <?php if ($myposts): ?>
    <?php global $post; ?>
    <?php foreach( $myposts as $post ) : ?>
    <?php   setup_postdata($post); ?>
       <?php the_title(); ?>
       <?php the_content(); ?>
    <?php endforeach; ?>
    <?php endif; ?>

    got this code but got this

    Parse error: syntax error, unexpected ‘ setup_postdata’ (T_STRING) in /Users/Carl/Siter/crossfit/wp-content/themes/GoMallorca/index.php on line 22

    what can be wrong? have I missed some settings?

    please help

    http://wordpress.org/extend/plugins/custom-post-type-ui/

Viewing 1 replies (of 1 total)
  • Plugin Author Michael Beckwith

    @tw2113

    looks like a php error in your code above. Nothing caused by the CPT UI plugin. Are you sure you’re passing in a $post object instead of just an array?

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] Cant get the content.’ is closed to new replies.