How to batch convert comments to posts?

You can copy this code into a plugin and when activated will convert all comments into posts, and delete the comments (so you will not have duplicates) You can also limit what kind of comments will be converted the posts using the parameters for get_comments ( http://codex.wordpress.org/Function_Reference/get_comments ) register_activation_hook( __FILE__, ‘wpse_29474_convert_to_posts’ ); function wpse_29474_convert_to_posts(){ $comments … Read more

permalink and $_GET

Is the reason you are adding the post_id to the URL because you are you trying to access the post_id variable in the template? You can do so much more easily by accessing it in the Loop of your template file <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); // Two … Read more

How can I make a custom post type that loops pages in a new dashboard page, each single page is a new dashboard page (all within the back-end)?

WordPress isn’t built with your idea in mind. That being said, add_menu_page on the WordPress Codex shows how to create an admin top-level menu page, i.e., a menu item within the left column of the admin section. add_submenu_page shows how to create submenus of top-level menu items. You could create a plugin, and add menu/submenu … Read more

How would I get a list of posts from a custom post type

$args = array( ‘post_type’ => ‘carousel’, ‘suppress_filters’ => 0, ‘numberposts’ => -1, ‘order’ => ‘ASC’ ); $content_block = get_posts( $args ); // there was a typo in this line var_dump($content_block); // it should work fine now PS. I’m not sure why do you need “an object” and you can’t do it with custom WP_Query. In … Read more

Target Post Type from array Query

$my_query->post_type refers to the post type of the query (in this case an array), and not the results. (Its recommended to use $my_query->get(‘post_type’) too, but anyway…). To get the current post’s (in the loop) post type: $post_type = get_post_type(); You can also use that function outside the loop by passing the post object / ID. … Read more