iframe not showing in post (with “allow php in posts” plugin activated)

I would say that’s a quirk with the plugin. In this case, it’s better to make a shortcode. Add this code to your functions.php file: function wpse_77036_embed_video( $atts ) { extract( shortcode_atts( array( ‘homepage’ => “https://wordpress.stackexchange.com/”, ‘currentpage’ => $_SERVER[‘REQUEST_URI’], ‘width’ => 560, ‘height’ => 315, ‘code’ => ‘I8M_uCnxhwY’, ), $atts ) ); if ( $homepage … Read more

How do I remove a category from a wordpress loop>

You can add category id or category slug into arguments you are passing to query_posts: <?php // category slug (‘products’) query_posts(array( ‘post_type’ => ‘post’, ‘showposts’ => 5, ‘category_name’ => ‘products’ ) ); ?> or <?php // category id (‘3’) query_posts(array( ‘post_type’ => ‘post’, ‘showposts’ => 5, ‘cat’ => ‘3’ ) ); ?> In the second … Read more

How to have different header.php based on the user logged in?

You can achieve this by getting the Membership Level of the current user, and making a conditional based on this. As I do not have a license for wishlist member, this is untested. I suppose $member_id to be the same value as the WordPress ID of the logged in User. <?php global $current_user; get_currentuserinfo(); $member_id … Read more

Is the 404 page automatically displayed if a loop returns nothing?

If you want to force the 404.php template to load if there are no found posts, use the template_include filter: function wpa84794_template_check( $template ) { global $wp_query; if ( 0 == $wp_query->found_posts ){ $template = locate_template( array( ‘404.php’, $template ), false ); } return $template; } add_filter( ‘template_include’, ‘wpa84794_template_check’ );

Make a database query using WordPress

if I understand you correctly, you might want something like this: global $wpdb; $number=30; // EDIT this to your needs $sql=”SELECT post_id FROM `wp_ak_popularity` ORDER BY `single_views` DESC LIMIT %d”; $my_top_posts = $wpdb->get_results($wpdb->prepare($sql,$number),ARRAY_N); to get an array of the top posts id’s. You could then use this in your WP_Query: ‘post__in’ => $my_top_posts

How to retrive the text : No movie by this actor

Something along these lines should work: if ( $the_query->have_posts()){ while ( $the_query->have_posts() ) : $the_query->the_post(); echo ‘<div class=”actor-box-related”><a class=”actor-titlu” href=”‘; the_permalink(); echo ‘” title=”‘.get_the_title().'”>’; ?> <img class=”actor-img” src=”/scripts/timthumb.php?src=<?php the_field(‘img’); ?>&h=110&w=75&zc=1″ alt=”<?php the_title(); ?>” title=”<?php the_title(); ?>”/> <?php the_title(); echo ‘</a></div>’; endwhile; } else { echo(“No movie by this actor”); }