how to show all post in my page-grid.php template page

<?php $args = array( ‘post_type’ => ‘put your custom PostType name here’, ‘posts_per_page’ => ‘-1’ ); $query = new WP_Query( $args ); if ( $query->have_posts() ) { while ( $query->have_posts() ) { $query->the_post(); // Contents of the queried post results go here. } } // Restore original post data. wp_reset_postdata(); ?>

How to build a post and comment editing form in a page?

To edit is a bit harder then just creating, but not that hard first you only display the edit link to the author so you add something like this to your loop: global $current_user; get_currentuserinfo(); while (have_posts()) : the_post(); //regular loop stuff //and check if the post author is the current user if ($post->post_author = … Read more

How to extract images of post and pages excluding header and logo image in wordpress?

I believe this will get you all of your attachments: $q = new WP_Query( array( ‘post_type’=>’attachment’, ‘post_status’=>’inherit’ ) ); var_dump($q); You could further restrict that by adding other parameters, for example, ‘post_mime_type’ => ‘image’ would restrict only to images. That will return all images though, not just the ones attached to posts. What you want … Read more

Hide page title in WordPress 3.0

the videos shows options that come with the headway theme, in order to see them you must use the headway theme. it’s not a build in functionality of WordPress, however you can use the_title filter to replace or remove the title for a specific post based on custom fields values like so: function my_title_filter($title){ global … Read more

WordPress post/page pagination (page links) to go back to the first section

If we want to add a First page link between Previous page and Next page links: Pages: Previous page First page Next page then we could use the wp_link_pages_args, wp_link_pages and wp_link_pages_link filters. Here’s one such example: Example First we check the next_or_number attribute to see if the next mode is active: add_filter( ‘wp_link_pages_args’, ‘wpse_initialize’ … Read more

Trying to list out child pages with WP_Query

I tested the query and it does work so the only thing I can spot that is misleading but not right is directly after you while() statement you have the_post(). This doesn’t work in secondary queries, it should look like: <?php if( $subpages->have_posts() ) : ?> <?php while( $subpages->have_posts() ) : $subpages->the_post(); ?> … <?php … Read more