Query for page content, and query for posts on the same page?

Use query link this. You are checking posts in $the_query. but you have used $query. <?php $custom_query = new WP_Query( ‘posts_per_page=4’ ); if ( $custom_query->have_posts() ) : while ( $custom_query->have_posts() ) : $custom_query->the_post(); ?> <h2><?php the_title(); ?></h2> <?php endwhile; else : get_template_part( ‘content’, ‘none’ ); endif; wp_reset_postdata(); ?>

display custom post type from register taxonomy

First off, I’d like to note a few things wrong with your Post Type and Taxonomy set up. There’s a few settings in your $labels that don’t make sense: $labels = array( … ‘post_type’ => ‘attachment’, ‘post_parent’ => $post->ID, ‘post_status’ => ‘inherit’, ‘post_mime_type’ => ‘image’, ); These last 4 options don’t make much sense ( … Read more

Add banner after the third post [closed]

It’s not related to WordPress at all, it’s a generic PHP question, hence off-topic here. It’s easy, follow the inline comments, and you can have it. 🙂 <?php //declare a counter $counter = 1; // Start the Loop. while ( have_posts() ) : the_post(); /* * Include the post format-specific template for the content. If … Read more

How to create a loop inside WP_Query?

Just construct what you need outside of the main query. // terms to search $meta_query_keys = array(‘Panera Group 2 Encino’, ‘West Hollywood’); // start the meta query off $meta_query = array(‘relation’ => ‘OR’); // add terms to query foreach($meta_query_keys as $key) { $meta_query[] = array( ‘key’ => ‘user_group_name’, ‘value’ => $key, ‘compare’ => ‘LIKE’, ); … Read more

Fatal error with wp-livechat plugin

The problem is that the plugin uses a function available in WordPress 4.4 and you probably have a lower version. Now to get you out of trouble, you could use FTP to reach your site’s files, navigate to wp-content/plugins/ and rename the directory of the troublesome plugin. This would force it to be deactivated. Now … Read more

how do i remove plusone js from WP? [closed]

http://apis.google.com/js/plusone.js is not a script that a default WordPress install tries to load. It’s likely coming from your theme or a plugin that adds social sharing buttons to your site. Try disabling all plugins to see if the warning still occurs. Then, re-activate each plugin one by one to find the culprit.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)