Side effects of Script and Iframe in post

The recommended method for embedding iframes is using the <iframe> tag. It makes for better syntax and also allows you to control the iframe much better. For example, you are able to remove an iframe’s border, control scrolling options, etc. <iframe src=”https://jsfiddle.net/o7usdL0a/embed/result/” style=”width: 100%; height: 300px” scrolling=”no” marginwidth=”0″ marginheight=”0″ frameborder=”0″> </iframe> The <script async> and … Read more

Insert Content In Between Post Feed

I’ve found old pieces of code and joined it with yours. It could be more elegant, but you have the idea. <?php $args = array( ‘category__not_in’ => array( 20 ), ); $query = new WP_Query( $args ); $posts = $query->posts; wp_reset_postdata(); $post_counter = 1; // secondary posts’ categories (ids) $sec_categories = [2, 14, 56, 234]; … Read more

display a random post thumbnail from a random category

All you need to do is to add another query in your code: function categorie_shortcode_callback() { $html=””; $categories = get_categories( array( // ‘type’ => ‘carte’, <- THERE IS NO ATTRIBUTE CALLED type FOR get_categories, SO REMOVE THAT ‘taxonomy’ => ‘carte-category’, ‘parent’ => 0 )); shuffle( $categories); // you also don’t need to loop through that … Read more

Posts will not display on page-mypage.php

You can use custom query to show post in your template $args = array( ‘post_type’ => ‘product’, ‘posts_per_page’ => 10 ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); the_title(); the_content(); endwhile;

Category Page Template not Showing Posts

You should never create your own custom WP_Query queries on category templates (or any other archive template) and use them as main loop. Why? Because it will break pagination. WordPress will still create all pagination links for such archives based on default query. So if you want to modify the query in such way, that … Read more