How to hide image alt text/caption in Visual Composer?

i had also the same issue when using the AVADA theme. It appends the title attribute on the image which is showing the text/caption when its being on hover. <script type=”text/javascript”> /* The first line waits until the page has finished to load and is ready to manipulate */ $(document).ready(function(){ /* remove the ‘title’ attribute … Read more

Show with echo if a post has two or more categories

To answer your question, if placed within the Loop – after, typically, while ( have_posts() ) : the_post(); in a single.php file – the code will work as follows: The has_category( array( ‘x’, ‘y’ ) ) condition will be satisfied if the post is in either x or y, or both, regardless of whether it … Read more

Display posts from another page on home page in wp-editor

I created shortcode in functions.php: add_shortcode(‘projects’, ‘projects_shortcode’); function projects_shortcode($atts){ extract(shortcode_atts(array( ‘post_type’ => ‘project’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => 3, //’caller_get_posts’ => 1 ), $atts)); $args = array( ‘post_type’ => $post_type, ‘post_status’ => $post_status, ‘posts_per_page’ => $posts_per_page ); global $post; $posts = new WP_Query($args); $out=””; if ($posts->have_posts()) while ($posts->have_posts()): $posts->the_post(); $overview_image = get_field(‘small_overview_image’); $out .= ‘<div … Read more

How to delete unnecessary custom post types in the UI

Currently there is no way on the backend (UI) for unregistering a post type, the process however is quite simple. Andrew Nacin provided some code over on https://core.trac.wordpress.org/ticket/14761 You can easily create a plugin with this function and have the CPT unregister. if ( ! function_exists( ‘unregister_post_type’ ) ) : function unregister_post_type( $post_type ) { … Read more

WordPress loop put title into variable

Creating variables on the fly like that is not needed. Just use an array instead. $myvars = []; inside your foreach loop you can: $myvars[] = array(‘title’=>$t,’image’=>$v); After your loop you can: //First title, First image echo $myvars[0][‘title’]; echo $myvars[0][‘image’]; //Second title, Second image echo $myvars[1][‘title’]; echo $myvars[1][‘image’]; This way you can always print_r($myvars) and … Read more

How make animation increase of number

i make this: $(window).scroll(function() { var currentNumber = $(‘.js-number-lifetime’).text(), targetNumber = $(‘.js-number-lifetime’).attr(‘data-target’); $({numberValue: currentNumber}).animate({numberValue: targetNumber}, { duration: 1000, easing: ‘linear’, step: function() { $(‘.js-number-lifetime’).text(Math.ceil(this.numberValue)); } }); var currentNumber1 = $(‘.js-number-clients’).text(), targetNumber1 = $(‘.js-number-clients’).attr(‘data-target’); $({numberValue: currentNumber1}).animate({numberValue: targetNumber1}, { duration: 1000, easing: ‘linear’, step: function() { $(‘.js-number-clients’).text(Math.ceil(this.numberValue)); } }); var currentNumber2 = $(‘.js-number-employee’).text(), targetNumber2 = $(‘.js-number-employee’).attr(‘data-target’); $({numberValue: … Read more

Create media library feed

Although your question appears to be about an xml feed for library images, the process to display those images on a page requires use of a template with a special query to look for ‘attachment’ type pages, which is how images are stored in the database. That’s a bit more complicated, but I did something … Read more