Can’t load search results with ajax

The JavaScript should be: <script> jQuery( document ).ready(function ( $ ) { $( “#searchform” ).on( “submit”, function ( ev ) { ev.preventDefault(); $.post( “<?php echo admin_url( ‘admin-ajax.php’ ) ?>”, { action: “wpa56343_search”, search: $( “#s” ).val() }, function ( response ) { $( “body” ).append( response ); } ); }); }); </script> And the AJAX … Read more

Get template part with CPT and Custom Taxonomy conditionals

Your order of your if/else statement is wrong. You would want to have your complex condition (or most important condition) at the top and the simplest (or least important condition) at the bottom. if/else statements work on the basis that the first condition that hits true will be executed. In your example above, if you … Read more

get_template_directory() returns wrong address on VPS

You can read data on your server with file_get_contents(). If you want to make sure the file exists and is readable then use is_readable(). You don’t really need to use trailingslashit() in this case because you’re constructing the URI yourself. // path to file under current theme $json_file = get_template_directory() . ‘/inc/includes/acf-fonticonpicker/icons/selection.json’; // make sure … Read more

get_template_part() Not Working in Loop

Thinking about my comment…wouldn’t it be simplier to say: <section id=”content” class=”site-content blog-page”> <div class=”container”> <?php if ( is_home() || ( is_front_page() && is_home() ) ) : ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <h2> There are posts but template parts aren’t found </h2> <?php get_template_part( ‘template-parts/post/content’, get_post_format() ); ?> <?php get_template_part( … Read more

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