What template is used for viewing Media Library Files?
You need to create attachment.php in your child theme. Please check here for more details.
You need to create attachment.php in your child theme. Please check here for more details.
Yes, you can use page template for your contact page. Page templates have nothing to do with SEO. The contents inside the page template do.
reference WordPress Codex on Templates A quick, safe method for creating a new page template is to make a copy of page.php and give the new file a distinct filename. That way, you start off with the HTML structure of your other pages and you can edit the new file as needed. To create a … Read more
Using AJAX in WordPress is fundamentally pretty simple. You need a function that handles the AJAX request, and a couple of add_action calls to map that function to the action you pass to admin-ajax.php, in this case, some_action: function wpd_ajax_function() { get_template_part( ‘my-content’ ); wp_die(); } add_action( ‘wp_ajax_some_action’, ‘wpd_ajax_function’ ); add_action( ‘wp_ajax_nopriv_some_action’, ‘wpd_ajax_function’ ); This … Read more
Ok. Figured it out. I had to register new query variable in my functions.php. add_filter(‘query_vars’, ‘register_qvs’ ); function register_qvs( $qvars ) { $qvars[] = ‘my_new_var_name’; return $qvars; }
wp-cli is not a development tool, it is a server admin tool, as such all the scaffold stuff there is…. for lack of better word, unneeded bloat. It is unlikely to reflect best practice, especially if your copy is old. In the specific case of page templates, there is really nothing worth “scaffolding” the easiest … Read more
I think the best way is to create Theme Options and let the administrator decide which page is each one, with a dropdown for example. This way you can get the selected page no matter the environment.
You should not hide functionality in a template file. Templates are dumb, you don’t run unit tests on them normally. I’d recommend to move the logic to a separate function in your functions.php: function header_class( $default=”white” ) { $post = get_post(); // 404 pages, empty archives (user, taxonomy, date) if ( empty( $post ) ) … Read more
There are 2 options: Copy the WooCommerce file into your theme, then make whatever changes you like. Since you’re using a default theme, you’d need to create a child theme. In this case, you’d copy /wp-content/plugins/woocommerce/templates/checkout/for-m-checkout.php (the whole file) into /wp-content/themes/yourchildthemename/woocommerce/checkout/form-checkout.php and do whatever you like – the child theme will also need a style.css … Read more
Well one approach would be to create a generic single-media.php file and put a condition inside it which checks for the specific taxonomy. Then you would be able to include the other two based on the condition. So, create the main template – single-media.php and the other two templates page-media.php and page-music-library.php. Then you could … Read more