WordPress child theme fails to override parent navigation menu in /inc/structure/header.php

You need to copy to your child and edit the function where the file is included, probably ´shop_isle_primary_navigation´, to change the path where the file is located. WordPress only loads automatically from child the default files, that’s the ones defined in template hierarchy. You can read more about this at https://developer.wordpress.org/themes/basics/template-hierarchy/

database interactions using OOP

This is potentially a fairly involved question, so I may not be totally rigorous in my answer, but this should give you a good start when creating and deleting tables.. Include the following lines in your plugin _construct() function of class_my_plugin.php: if (is_admin()){ //manage the the database tables when registering or deactivating register_activation_hook($loc, array($this, ‘your_plugin_installation’)); … Read more

Can’t get page content in WordPress

Wrap the_content() function like below $args = array( ‘post_type’ => ‘your-custom-post-type’, ); $query = new WP_Query( $args ); while( $query->have_posts() ): $query->the_post(); the_content(); endwhile; wp_reset_postdata(); one thing to note here though, you must know where to end the loop ( i.e., endwhile; ) as you’ve other markup in the page template ( I assumed that … Read more

How to stop featured image thumbnail [set as background image] on blog index page just repeating same image across all posts

Or is it because im trying to add it to the css class .has-post-thumbnail which is applied to all posts? Yes, set_featured_background() gets first post from the loop and add .has-post-thumbnail to styles. All posts that have thumbnail (with class .has-post-thumbnail) will have the same background. Try setting the background in the template file responsible … Read more

wp_remote_get adding backslashes

wp_remote_get() returns an array containing the response headers and the response body. When you json_encode() the response, which you appear to have done, then the body is going to be escaped so that it doesn’t break the JSON it thinks you’re trying to create. You’re adding the slashes when you do this. To get the … Read more

Custom Field Order by Last Name and First Name

Your code has a few issues, some unrelated, but generally, you need named meta queries to order by multiple meta keys: $posts = get_posts( [ ‘post_type’ => ‘soldier’, ‘posts_per_page’ => 5, ‘paged’ => $soldier_paged, ‘meta_query’ => [ ‘last_name_clause’ => [ ‘key’ => ‘last_name’, ‘compare’ => ‘EXISTS’ ], ‘first_name_clause’ => [ ‘key’ => ‘first_name’, ‘compare’ => … Read more

Get_avatar filter?

I am giving you example from storefront WordPress theme because it’s the best theme which explains everything what you want to know so here the code which is in it’s comments.php <ol class=”comment-list”> <?php wp_list_comments( array( ‘style’ => ‘ol’, ‘short_ping’ => true, ‘callback’ => ‘storefront_comment’, ) ); ?> here storefront_comment is a callback function which … Read more