WordPress.org

Ready to get started?Download WordPress

Forums

Custom Post Type UI
[resolved] Cant get the content. (2 posts)

  1. dunderhonung
    Member
    Posted 1 year ago #

    <?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/

  2. Michael Beckwith
    Member
    Plugin Author

    Posted 1 year ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.