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

Multi-step, live updating search

It sounds like you need conditional form fields for selecting your criteria based on previous criteria selection, then for live filtering, you would use an ajax filter instead of the regular form submit. I assume you are filtering WordPress posts. If you search for “conditional form fields” and “wordpress ajax filter” you should find lots … Read more

JQuery Error in theme for .live is not a function [closed]

If you asking what is the replacement for .live() it’s .on()`, for enabling event handling for dynamically added elements and that’s how you would use it. $(document).on(“click”,”#test-element”,function() {}); so for your code. $(‘body’).on(‘click’, ‘.top_add_card’, function(event){ var parent = $(this).parent(); var $this_btn = $(this); var $target_block = $this_btn.siblings(‘div’); event.preventDefault(); event.stopPropagation(); if(parent.hasClass(‘active’) && $target_block.hasClass(‘hm_active_prep’)){ $target_block.fadeOut(function(){ parent.removeClass(‘active’); } … Read more

Mailchimp Popup on homepage only with is (front_page) [closed]

You have a couple problems. First, the ! in the conditional means “NOT.” Secondly, the || means “OR”. In other words, your conditional translates to: If this is NOT the front page OR this is NOT the post archive page That describes every page. Try this instead: <?php if ( is_front_page() ) :?> <script id=”mcjs”>!function(c,h,i,m,p){m=c.createElement(h),p=c.getElementsByTagName(h). … Read more

Custom template not working for existing pages [closed]

as a solution, you can fully automate the selection of a template for a group of pages using slug names: add_filter(‘request’, function( $vars ) { $slug = explode(“https://wordpress.stackexchange.com/”, explode(‘?’, $_SERVER[‘REQUEST_URI’])[0]); array_pop ($slug); $temp_base = “…first_part_template_name…”; $temp_slug = array_pop ($slug); if (file_exists(get_template_directory().”https://wordpress.stackexchange.com/”.$template.’-‘.$temp_cat.’.php’)) { get_template_part( $temp_base, $temp_slug ); } }

Is there ever a legitimate reason for an outsider to access wp-admin

Yes, lots of themes and plugins make use of the wp-admin/admin-ajax.php file, and some use wp-admin/admin-post.php. But beyond that there’s little to no reason to access wp-admin. Perhaps a search engine trying to determine if I’m running wordpress? Search engines don’t care so much if you are or aren’t using WordPress, you would be able … Read more