How do I insert JS tracking code to a page with the WP editor?

Use conditional tags. Change the 5th parameter to load in the footer. Change get_stylesheet_directory_uri() to get_template_directory_uri() for use in parent themes. add_action( ‘wp_enqueue_scripts’, ‘add_tracking_scripts’ ); function add_tracking_scripts() { if ( is_page(‘slug’) ) { wp_register_script( ‘tracking-script’, get_stylesheet_directory_uri() . ‘/tracking-script.js’, false, ‘1.0’, true ); wp_enqueue_script( ‘tracking-script’ ); } } Source http://codex.wordpress.org/Function_Reference/wp_enqueue_script

Is there a way to set different post templates for parent posts and child posts in the same post type?

Simplest way is to use single_template filter hook (one of the {$type}_template hooks). It is fired by WordPress to filter the template file found for singular post requests. add_filter(‘single_template’, function($template) { $queried = get_queried_object(); if ( $queried->post_type === ‘clients_projects’ ) { // only for this CPT // file name per OP requirements $file=”clients_projects_”; $file .= … Read more

Conditionally display different images before the content in a page template

You could try the loop_start hook depending on what position you want the image and use the code in your functions file. add_action(‘loop_start’, function() { if(is_page(10)) { echo do_shortcode(‘[plugin_shortcode 1 …..]’); } else if (is_page(11)) { echo do_shortcode(‘[plugin_shortcode 2 …..]’); } else if (is_page(15)) { echo do_shortcode(‘[plugin_shortcode 3 …..]’); }}); Or you could pull the … Read more

Cannot edit style.css from admin panel, because the template is looking for style.min.css

Best practice is to use a child theme instead. A plugin like Simple Custom CSS is another option. Two alternate quick fixes: Disable the filter that selects style.min.css by commenting out this line in origin/library/function/styles.php: add_filter( ‘stylesheet_uri’, ‘hybrid_min_stylesheet_uri’, 10, 2 ); Delete style.min.css 🙂 There is no auto-generation of minified files within WordPress.

How to display only posts assigned to a particular, isolated, subcategory

We can change the default behaviour of including posts attached to child categories by mapping the category_name query var (set from pretty permalinks) to category__in (which ignores child categories): function wpse_184127_ignore_category_children( $wp_query ) { if ( $wp_query->is_main_query() && $wp_query->is_category() && $name = $wp_query->get( ‘category_name’ ) ) { if ( $term = get_term_by( ‘slug’, sanitize_title_for_query( $name … Read more

Create a free scripts and styles template within a plugin

It seems a little odd to only offer the admin bar for a page, but the easiest solution I can think of would be to use conditional functions to deregister scripts/styles and create custom template files for this specific page. Unfortunately, you’ll have to figure out all the styles/scripts that are loaded add_action(‘init’, ‘remove_all_the_things’); function … Read more