Hot answers tagged

2

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.


2

Use wp_enqueue_scripts instead on init. This will ensure you the template is already loaded. add_action('wp_enqueue_scripts', 'maps_scripts'); Or you try to check the template using get_page_template_slug() instead of is_page_template: $tmp = get_page_template_slug($post_id); // provide page/post ID if('page-about.php' == $tmp) { // enqueue scripts ...


1

In regard to WordPress post paged, I would use /player-12345 or other structure as url specific page rather than /player/12345. How to create new url structure for page Creating additional url structure, you need WP_Rewrite, there are a couple of filters that you can fire with your function. For Page, you can filter page_rewrite_rules. See example code on ...


1

After some digging I found the answer! Hopefully this helps some other people! EDIT Improved Answer! <?php $args = array( 'post_parent' => get_the_ID(), 'post_type' => 'airports', 'posts_per_page' => -1 ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); ?> <h2><?php the_title(); ...


1

You need to create attachment.php in your child theme. Please check here for more details.


1

You can use Options API or Setting API to store the data in the database. Write a plugin to create a meta box for the introduction text and show that text on the archive-unicorn.php. Or you can utilize the description parameter when you register_post_type and print it in the archive-unicorn.php like this: $unicorn_obj = get_post_type_object('unicorn'); if ...


1

You can try to build some options custom page to allow users to change some text. there are many plugins for easily creating that functionality. I will suggest you the most popular - https://www.advancedcustomfields.com/add-ons/options-page/ You can use the following code with ACF PRO: /** * Create ACF setting page under Campaign CPT menu * * @since ...


1

The best practice for editing a Woocommerce theme is similar to Wordpress as you should use Hooks and Filters when possible. https://docs.woothemes.com/document/introduction-to-hooks-actions-and-filters/ But if you do need to edit a template Woocommerce outlines this on their website as well: https://docs.woothemes.com/document/template-structure/ You just ...


1

You are probably confused by the output of array_values() which will always get you only array values without keys while $atts variable is actually an associative array. To extract your attribute use $arr = $atts['tablepageid']; Cheers



Only top voted, non community-wiki answers of a minimum length are eligible