Remove W3 Total Cache minified files on custom page outside of WordPress [closed]
You can add DONOTMINIFY define statement to this page to disable it or switch to manual minify mode where this template has no settings.
You can add DONOTMINIFY define statement to this page to disable it or switch to manual minify mode where this template has no settings.
If you have your custom post type rewrite rules set up properly, you shouldn’t need to create a new WP_Query in your template file. Comment out the new WP_Query line or rename your portfolio-single.php so WP pulls from the default single.php and see if it pulls the proper post. You can also call echo $post->ID … Read more
i’m not sure what you are trying to achieve w/ the $paged variable. seems like you could simplify your query though $posts_per_page = is_paged() ? 5 : 2; $args=array( ‘post_type’=>’post’, ‘category_name’ => ‘featured-content’, ‘posts_per_page’ => $posts_per_page ); $temp = $wp_query; $wp_query= null; $wp_query = new WP_Query($args); edit, adding an offset (and fixing syntax errors): $paged … Read more
no idea what the problems actually are, but from looking at the code, I woud suggest: a: the while (have_posts()) : should be while ($the_query->have_posts()) : b: you would need to increment the counter: <?php $count = $count + 1; ?> c: the endif; of the loop might be missing after the endwhile; – at … Read more
the_category() only works for the “Category” taxonomy which doesn’t appear to be hooked to your custom post type. I see you’re registering a custom taxonomy. If you want to show the terms from that taxonomy that are assigned to the post, you’ll need to use the_terms() or get_the_terms(): the_terms( $post->ID, ‘fgaleri’, ”, ‘, ‘, ” … Read more
Open up content.php and replace this: <?php post_class(); ?> …with this: <?php post_class( ++$GLOBALS[‘wp_query’]->wpse60971_current_post % 2 === 0 ? ‘even’ : ‘odd’ ); ?>
You could even try passing ‘post_parent’ => 0 to the query. In your case it would be $query->query( ‘post_type=pages&post_parent=0’ );
i´m not sure to understand your question, but why not use this logic in your function? if ( is_user_logged_in() ) { echo ‘Welcome, registered user!’; do your stuff PHP and inject in content… } else { return standard content or block it; } and maybe additional test to limit with current_user_can( $capability ), and so … Read more
When you’re calling $loop->the_post(), you’re replacing the global $post instance. You need to call wp_reset_postdata() after your while loop.
Try this. $type=”buehne”; // Name of the Custom Post Types $tag = ‘TagName’; $args = array( ‘post_type’ => $type, ‘paged’ => $paged, ‘posts_per_page’ => -1, ‘orderby’ => ‘menu_order’, ‘order’ => ‘ASC’, ‘tax_query’=>array( array( ‘taxonomy’=>’th3’, //name of the Taxonom ‘field’=>’slug’, ‘terms’=>array($tag) )) ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); if(is_object_in_term($post->ID,’th3′,’TagName’)) … Read more