WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Magic Fields] archive page showing a list of post custom post (1 post)

  1. Martino Stenta
    Member
    Posted 2 years ago #

    I'm using Magic Fields and everything is ok in the "single" page.
    I get my custom fields (checkboxes, file uploades, date picker) using a custom template but i'm forced to use the write panel as a page (don't know if this is ok or not).

    Anyway the big problem arises when I try to have a page showing the last n posts created with the plugin.

    With Custom Post Type UI I was able to do something like this

    <?php $my_query = new WP_Query( array( 'post_type' => 'special-post', 'posts_per_page' => 10 ) ); ?>
    
    <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
    
    <a href="<?php echo get_permalink(); ?>"><?php echo get_the_post_thumbnail( $id, array(75,75), $attr ); ?></a><br>
        <a href="<?php echo get_permalink(); ?>"><?php echo strip_tags(get_the_term_list( $post->ID, 'var1', '', ', ', '' )); ?></a><br>
    <a href="<?php echo get_permalink(); ?>"><?php echo strip_tags(get_the_term_list( $post->ID, 'var2', '', ', ', '' )); ?><br>
    <a href="<?php echo get_permalink(); ?>"><?php echo strip_tags(get_the_term_list( $post->ID, 'var3', '', ', ', '' )); ?></a>
    <br><?php echo strip_tags(get_the_term_list( $post->ID, 'var4', '', ', ', '' )); ?></a>
    <?php endwhile; ?>

    What I'm looking for is the same thing to get the posts form the Magic Field posts but i don't know that to use here:
    <?php $my_query = new WP_Query( array( 'post_type' => 'WHAT_KIND_OF_POST?', 'posts_per_page' => 10 ) ); ?>

    Any help is really appreciated.

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 2 years ago by Martino Stenta
  • This topic is not resolved
  • WordPress version: 3.1.4