How to remove the Template drop down, but keep Parent and Order

When you remove that box from admin (as you’ve written in the comment), you should be able to re-register that box with custom function (modified original) to render the box: if ( post_type_supports($post_type, ‘page-attributes’) ) add_meta_box(‘pageparentdiv’, ‘page’ == $post_type ? __(‘Page Attributes’) : __(‘Attributes’), ‘my_page_attributes_meta_box’, null, ‘side’, ‘core’); function my_page_attributes_meta_box($post) { $post_type_object = get_post_type_object($post->post_type); if … Read more

Show all parts in multipage post

Well, you can turn it off completely or use the following code along with some sort of conditional statement to switch it on or off. The multipage part is set up in the setup_postdata() function in wp-includes/query.php. There’s an action at the end of the function called the_post. If you hook onto that and then … Read more

LaTeX for WordPress strips codes in loop

I don’t know much about that plugin but it applies filters to both the_content and the_excerpt, which seems reasonable to me. I have to assume that your theme is bypassing those filters somehow in the index listing. I can only guess at what it is doing, but you could add a filter to get_the_content and … Read more

Why write markup for index.php?

WordPress might extend the existing template hierarchy in a future version. Your users would get a blank page after an upgrade. So write at least the basic loop, header, footer and pagination. Another point: I use and see at the index.php usually as the default template. I treat its layout as the core concept and … Read more

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.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)