Skip to content

Instantly share code, notes, and snippets.

@hunk
Created September 30, 2009 03:31
Show Gist options
  • Save hunk/197735 to your computer and use it in GitHub Desktop.
Save hunk/197735 to your computer and use it in GitHub Desktop.
<?php
query_posts('meta_key=_mf_write_panel_id&meta_value=id_of_the_Write_Panel&showposts=-1');
//The Loop
if ( have_posts() ) : while ( have_posts() ) : the_post();
//you code
endwhile; endif;
//Reset Query
wp_reset_query();
//OR
$movie = new WP_Query('x__mf_write_panel_id=id_of_the_Write_Panel&showposts=-1');
//The loop
if ($movie->have_posts()) : while ($movie->have_posts()) : $movie->the_post();
// you code
endwhile; endif;
// {id of the Write panel} http://img.skitch.com/20090930-8u4s69g37mr3as27c8m434hgmx.jpg
?>
@thommeredith
Copy link

Make sure you also set the post_type to be whatever post type your need, i.e. this will not work if you need a list of pages so use

query_posts('meta_key=_mf_write_panel_id&meta_value=id_of_the_Write_Panel&showposts=-1&post_type=page');

@andylou
Copy link

andylou commented Apr 27, 2012

I can't find the id.
http://www.crossmap.com/2012NEW/00_WP/wp-admin/edit.php?post_type=images

I create new post type images, I want a list of post-type images (4 list) how can I do that

@hunk
Copy link
Author

hunk commented Apr 27, 2012

Hi andylou this is for MF1

@andylou
Copy link

andylou commented Apr 27, 2012

I am using magic field 2 how can you list only certain post type?

@andylou
Copy link

andylou commented Apr 27, 2012

Sorry, I am new to wordpress. How can I write it, is it to the template or function.php? how can I can I list 4 item (newest) from post-type=image. Can you show me a short code to begin with?

@harellevy
Copy link

is there any way to do so in MF2?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment