How to show single category archive
How to show single category archive
How to show single category archive
Woocommerce specific product template for product type
Found the solution: functions.php: add_action(‘init’, ‘wp_university_full_rewrite’); function wp_university_full_rewrite() { add_rewrite_rule( ‘university/([^/]*)/?$’, ‘index.php?pagename=university&uni_name=$matches[1]’, ‘top’); } add_filter(‘query_vars’, ‘wp_university_full_query_vars’); function wp_university_full_query_vars( $query_vars ) { $query_vars[] = ‘uni_name’; return $query_vars ; } function get_data_with_query( $name_query ) { $data = []; global $wpdb; $data = $wpdb->get_row(“SELECT * FROM table WHERE name=””.$name_query.”””, ARRAY_A ); return $data; } custom_template.php: <?php $name_pull = … Read more
Driss, I tend to break up css and javascript that’s specific to a template into files specifically for that template – that way if it’s not needed on every page, I’m not loading it and thus that allows me to keep my main.js and style.css smaller. Here’s how I normally do it: if( is_page_template( ‘room.php’ … Read more
First, you’ve got a heck of an obvious coding error in every one of your wp_enqueue_style calls: you have spaces in your quotations. Furthermore, because you are choosing not to call the wp_head() method, the hook of the same name will not be called. That hook, in turn, calls the wp_enqueue_scripts method, which calls the … Read more
I’m not overly familiar with search results pages and how you edit them, but a quick fix for the problem you have is to check for an empty string in the first bit of code and say “Please enter a search term” or something if there isn’t one entered. You’d achieve that with something like: … Read more
The taxonomy template you have (taxonomy-insight_type-academia.php) is in the form of (taxonomy-{taxonomy}-{term}.php), and the format for is_tax() is is_tax( ‘<taxonomy>’, ‘<term>’ ), so in your pre_get_posts callback, you should: // Use this. if ( $query->is_tax( ‘insight_type’, ‘academia’ ) ) // Not this. if ( $query->is_tax( ‘academia’, ‘insight_type’ ) ) Additionally — to avoid conflict with … Read more
Default Template Selected After Changes in Elementor [closed]
You can use this code once set page template for specific post. If the template isn’t set, you cant enqueue your script. if ( $post->_wp_page_template === ‘sky-template.php’ ) { wp_enqueue_script(); } Remember to replace sky-template.php with your template file name. Edit: You can get some help from this question. _wp_page_template to dynamically use template
Get and insert order email address to the PHP template inside HTML text