load common thank you template with different content for different pages
Create 25 child pages in the admin area and set them to use your template, then update the content for each page to match its parent page
Create 25 child pages in the admin area and set them to use your template, then update the content for each page to match its parent page
Glad that you managed to figure out a solution, which yes, does work. But you could make it more selectively, i.e. target just the specific pages, by using is_single( ‘<parent slug>/<child slug>’ ), e.g. is_single( ‘family-law/success-stories’ ) in your case. Secondly, it’s not exactly the redirect_canonical hook which caused the (301) redirect on singular paginated … Read more
<?php $current_page_id = get_the_ID(); wp_list_pages(“child_of={$current_page_id}&sort_column=menu_order&title_li=”); ?> Please check the above code
Use wp_get_attachment_image( $id ). Sample code: print wp_get_attachment_image( $main_image, array ( 80, 80 ), FALSE, array ( ‘alt’ => ‘portrait’ ) );
sort_column is not a valid parameter for WP_Query. You want orderby. sort_order is also not a valid parameter. It should just be order. $all_wp_pages = $my_wp_query->query( array( ‘post_type’ => ‘page’, ‘order’ => ‘ASC’, ‘orderby’ => ‘menu_order’ ) ); The Codex is your friend.
Instead of putting something on the template, you can keep templates clean and add to functions.php a function that use ‘template_include’ action hook to check parent page template and return same template for children pages. add_action(‘template_include’, ‘auto_child_template’); function auto_child_template( $template=”” ) { if ( ! is_page() ) { return $template; } else { $page = … Read more
If I read your question correctly you just need to set the ‘about’ page as a parent to ‘contact’ and ‘opening hours’ then the permalink will be how you want it. To do this go edit page of ‘contact’ and in the page attributes box set the parent to ‘about’ page.
You’re close, the query var for passing page slug is pagename: add_filter(‘query_vars’, ‘add_account_edit_var’, 0, 1); function add_account_edit_var($vars){ $vars[] = ‘account-edit’; return $vars; } add_action( ‘init’, ‘add_account_edit_rule’ ); function add_account_edit_rule() { add_rewrite_rule( ‘^my-account/([^/]*)/?’, ‘index.php?pagename=my-account&account-edit’, ‘top’ ); } To capture the value in your rule, you need to pass the value in $matches[1]: add_rewrite_rule( ‘^my-account/([^/]*)/?’, ‘index.php?pagename=my-account&account-edit=$matches[1]’, ‘top’ … Read more
wp_list_pages can take child_of param, to show only pages that are children of given page. But you have to pass the ID of that parent page (so you can’t put a slug in there). But you can use get_page_by_path to get a page object based on slug of the page. And another thing you have … Read more
Updated Answer — @Quasimodo confirmed that they’re only interested in posts of the page type and that the numeric slugs are four-digit years, e.g. 2019. What can I do to allow numeric slugs for child pages? I would use the pre_wp_unique_post_slug hook that runs prior to wp_unique_post_slug, which means we’ll be filtering the slug before … Read more