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.

Query posts only shows 1

OK this is the thing: I used a query $args = array( ‘post__in’ => array($userPostsInternal), Taking the fact the following is a string var_dump($userPostsInternal); -> string(13) “128537,128545” I thought declaring the array here would work array($userPostsInternal) But it’s not, therefore thanks to a comment, suggesting me to explode $userPostsInternal converting the string into an array, … Read more

how to use transient method?

First, you don’t need a raw SQL query, and by using one you give up all of WP’s optimisations. For example, if you run the query twice, it runs twice. If you had used WP_Query to getch those posts though, it would save them the first time to avoid making additional queries. It’s even possible … Read more

Carousel slider with WP_Query to show 3 posts on each slide

Despite your question is a generic PHP programming problem, what you’re trying to do can be achieved like so, where the key is the $i which is a custom while counter: <div class=”carousel-inner” role=”listbox”> <?php if ( $popular_services->have_posts() ) : $i = 0; // add this counter while ( $popular_services->have_posts() ) : $popular_services->the_post(); ?> <?php … Read more