How Can I setup WP CLI on Windows development machine running AMPPS?

Installing wp-cli through Composer is the way to go. For instance: $ cd C:\ $ composer create-project wp-cli/wp-cli –no-dev Copy the path to the bin directory inside the wp-cli directory (something along the lines of C:\wp-cli\bin) Add copied path to the Windows Path variable (tutorial) Exit all CMD’s (or git bash) and reopen them. Now … Read more

Checking if there is an Image inserted – if not don’t display anything

Try the following code: <div class=”item active <?php // If image URL is empty, echo “hidden” echo (get_theme_mod(‘slider_one’, ”) == ” ? ‘hidden’ : ”); ?>”> <img class=”img-responsive” src=”https://wordpress.stackexchange.com/questions/217340/<?php echo esc_url( get_theme_mod(“slider_one’, ” ) ); ?>” alt=”Slider 1″> </div> Then use the following CSS: .hidden { display: none } What this will do is: If … Read more

Remove css styles from specific page

You can use conditional tags to target the specific page you need to remove the styles on. You can use is_page() to target a page page (as opposed to another post type) and pass a page ID, slug, title, or no argument to target any page. function wpse_217881_remove_scripts() { // Check for the page you … Read more

How to add suggest plugin to theme?

TGM Plugin Activation is the most popular PHP library among WordPress theme developers to allows them to easily require or recommend plugins for your WordPress themes (and plugins). It allows your users to install, update and even automatically activate plugins in singular or bulk fashion using native WordPress classes, functions and interfaces

How to add multiple custom widget areas

You have to register multiple areas: function new_sidebar_widget_init() { register_sidebar( array( ‘name’ => ‘new-sidebar’, ‘id’ => ‘new-sidebar’, ‘before_widget’ => ‘<div id=”new-sidebar”>’, ‘after_widget’ => ‘</div>’, ‘before_title’ => ”, ‘after_title’ => ”, ) ); register_sidebar( array( ‘name’ => ‘new-sidebar-1’, ‘id’ => ‘new-sidebar-1’, ‘before_widget’ => ‘<div id=”new-sidebar”>’, ‘after_widget’ => ‘</div>’, ‘before_title’ => ”, ‘after_title’ => ”, ) ); … Read more

Similar Posts – NO plugin

Put this in your single.php: $tags = wp_get_post_tags($post->ID); if ($tags) { $first_tag = $tags[0]->term_id; $args=array( ‘tag__in’ => array($first_tag), ‘post__not_in’ => array($post->ID), ‘showposts’=>4, ‘caller_get_posts’=>1 ); $my_query = new WP_Query($args); if( $my_query->have_posts() ) { while ($my_query->have_posts()) : $my_query->the_post(); // post content stuff here endwhile; wp_reset_query(); } }