‘posts_per_page’ => ’10’ does not show any post

after days of research, I found that the fault was simply in the pagination. By changing the pagination code, I have made it work. <?php $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $custom_args = array( ‘post_type’ => ‘veranstaltungen’, ‘orderby’ => ‘date’, ‘order’ => ‘DESC’, ‘paged’ => $paged, ‘posts_per_page’ => ’10’ ); $wp_query = new WP_Query($custom_args); … Read more

Get attachment if matches a variable

$attachments holds array of posts, you are missing something like: $attachment = $attachments[0]; or foreach( $attachments as $attachment ) Update Nope, like this: foreach( $attachments as $attachment ) if ($attachment->post_title == $programme) { echo the_attachment_link($post->ID, false); break; }

How do i put a sidebar on my post permalink page?

The template for the display of a single post is single.php Add <?php get_sidebar(); ?> in the second last line of that file just above <?php get_footer(); ?> and the sidebar will show. Note: This will get overwritten, if you ever update the theme.

Viewing category won’t show up Custom post type posts

Blockquote Taxonomy category with a term with id 9 dosen’t have a posts with post type blog. Are you sure that you using native category taxonomy for CPT blogs posts? function query_report($sql){ var_dump($sql); echo ‘<hr>’; return $sql; } add_filter(‘query’, ‘query_report’); query_posts($your_arguments); remove_filter(‘query’, ‘query_report’);