How to get_term_meta on single custom post?

You will need to use get_the_terms() to get the taxonomy terms associated with the post and loop through them until you find one that has an image set: $post. = get_queried_object(); $terms. = get_the_terms( $post, ‘taxonomy_name_here’ ); $image_url = null; if ( $terms && ! is_wp_error( $terms ) ) { foreach ( $terms as $term … Read more

Plugin Admin Menu Boiler Plate

This is a great question. I have never seen any kind of framework inside WordPress for building forms, and after a bit of searching now to verify this, I don’t think there is one, although I’m sure others will correct me if there is 😉 So, you probably need to hand code forms as you … Read more

Undefined get_header function

What you downloaded was not a replacement for WordPress, it was a theme. Themes need to go inside the wp-content/themes folder. Once a theme folder is placed correctly it should appear as an option in the theme menu in WP Admin where you can preview and activate it. In the meantime, you need to reinstall … Read more

Woocommerce – Change the template?

The dropdown box that you are talking about is for custom WordPress template that WordPress supports by default. In order to override woocomerce template e.g. single-product.php what you have to do is to create a folder with name woocommerce inside your theme folder e.g. /wp-content/themes/{your_theme_name}/woocommerce/ and copy the file from /wp-content/plugins/woocommerce/templates/single-product.php into your theme’s woocommerce … Read more

Create page template via functions.php?

Your previous question, Possible to create a “variant” page template that only contains differences and is therefore resilient to updates of original (ie page.php)?, provided nicely more context to this question. As you Sally CJ noted in the comments you use theme_page_templates to add custom template to the template select list. To skip adding a … Read more

Utilising an existing page while using the “s” query parameter

Custom Query Var Moving s to a custom query variable when a page is explicitly requested should be simple enough: function wpse390935_set_page_search_qv( $wp ) { $qvs = $wp->query_vars; if( empty( $qvs[‘s’] ) || ( empty( $qvs[‘pagename’] ) && empty( $qvs[‘page_id’] ) ) ) return; $wp->query_vars[‘page_search’] = $qvs[‘s’]; unset( $wp->query_vars[‘s’] ); } add_action( ‘parse_query’, ‘wpse390935_set_page_search_qv’ ); … Read more