wp enqueue style and style sheet depth

You can add a priority number to the wp_enqueue_scripts action. So you could could give the action hooked to the enqueue of yourstyle sheet a priority of 999. Like so: function high_priority_style() { Wp_enqueue_style(‘important’, get_template_directory_uri() . ‘/css/important.css’); } add_action(‘wp_enqueue_scripts’, ‘high_priority_style’, ‘999’); A simpler way to do is enqueue all of your stylesheets, including style.css in … Read more

Is Auto Post recognition a WordPress feature? How to turn it off?

This is done by redirect_guess_404_permalink(), which is called from redirect_canonical(). redirect_canonical() does more than just this: it makes sure you are always using a single canonical URL for an item, it will add slashes, force the same domain name, … You can either unhook redirect_canoncial so it does nothing, or you can hook into it … Read more

Customizer Show/Hide Logo and Site Title

Try this function, why going through js when you can just do it with php inside your same file customizer.php /* ** show site title or hide it */ function showtitle_slogan() { $showttlslogan = get_theme_mod(‘display_site_title’); if ($showttlslogan == true) { ?> <style type=”text/css”> .site-title { display:none;} </style> <?php } } add_action(‘wp_head’, ‘showtitle_slogan’); And do the … Read more

Exclude pages with certain template from wp_list_pages

Daniel, exclude parameter doesn’t accept array. Use your code this way: $exclude = []; foreach(get_pages([‘meta_key’ => ‘_wp_page_template’, ‘meta_value’ => ‘page-templates/page-noindex.php’]) as $page) { $exclude[] = $page->post_id; } $args = array( ‘exclude’ => implode(“,”, $exclude), ‘title_li’ => ”, ‘sort_column’ => ‘menu_order, post_title’, ‘post_type’ => ‘page’, ‘post_status’ => ‘publish’ ); wp_list_pages($args); I think you can refactor it … Read more

show number of posts posted today

You can use WP_Query like this: // we get the date for today $today = getdate(); //we set the variables, i am ignoring sticky posts so they dont get counted $args = array( ‘ignore_sticky_posts’ => 1, ‘posts_per_page’ => -1, //all posts ‘date_query’ => array( array( ‘year’ => $today[“year”], ‘month’ => $today[“mon”], ‘day’ => $today[“mday”], ), … Read more

Failed to open stream / no such file or directory

It could be 2 things Most like it’s your file permissions. It is probably that your apache isn’t able to open the files set files to 0644 and directories 0755. The other problem could be your php version. Since you are upgrading to a new server, why not get the php in version 7? php … Read more

Having Issues on Using PHP glob() in WordPress

You should use paths with glob, not URLs. But src attributes needs URLs. So something like this should work: $base_dir = trailingslashit(get_template_directory()); $dir=”img/services/”; $images = glob($base_dir.$dir.’*.png’); foreach($images as $image) { $url = get_theme_file_uri($dir.basename($image)); printf(‘<div class=”dynamic item”><img src=”https://wordpress.stackexchange.com/questions/288995/%s” alt=””></div>’, esc_url($url)); } Where I make use of: get_template_directory To obtain the root path of (parent) theme basename … Read more

How to override a non pluggable and non hookable function in a WordPress parent theme?

to redefine the AJAX action, you can try that add_action(AE_Base::AJAX_PREFIX . “ae-profile-sync”, function () { $profile_action = $GLOBALS[“et_freelance”]->profile_action; // remove base action remove_action( AE_Base::AJAX_PREFIX . “ae-profile-sync” , [ $profile_action, “sync_post”, ] , 10 ); // add new AJAX action add_action( AE_Base::AJAX_PREFIX . “ae-profile-sync” , function () { // new code here } ); }, 1); … Read more

Use WordPress Text Editor in non-wp page

Including wp_load.php performs WordPress core load and gives you access to normal (front-end) set of WordPress functions. You might need to include some files from admin area by hand to get access to functions from there. You will also need to call some WP hooks or deal with scripts manually. Overall this is doable, but … Read more

display most popular tags in two columns

In my opinion you are doing it so complicated. I would rather do a classic query and then through css it made into 2-column. function top_tags() { $tags = get_the_tags(); if($tags) { $output=”<h4>Top tags</h4> <ul class=”top_tags”>”; foreach($tags as $tag) $output .= ‘<li><a href=”‘.get_tag_link($tag->term_id).'” title=”‘.$tag->name.'”>’.$tag->name.'</a></li>’; $output .= ‘</ul>’; echo $output; } } and your css .top_tags … Read more