Edit custom HTML page from WP admin dashboard

If you want content to be editable via the dashboard, a static HTML file is not the road you want to take. Instead, create a custom page template, from which you call a custom header and footer. Both get_header() as well as get_footer() take an optional $name parameter to specify a specific template to call … Read more

Get page content and execute shortcodes on a page

function get_page_func( $atts ){ extract(shortcode_atts( array( ‘title’ => ” ), $atts ) ); $page = get_page_by_title($title); $args = array( ‘include’ => $page->ID, ); $pages = get_pages($args); $html = $pages[0]->post_content; $html = do_shortcode($html); return $html; } add_shortcode( ‘get_page’, ‘get_page_func’ ); Use above code. Wherever you require shortcode to be executed just use the following line echo … Read more

page-name.php doesn’t execute on custom template

Don’t name your custom page template files page-{foobar}.php. Doing so will cause just this conflict with the Template Hierarchy for static pages: custom template file – The Page Template assigned to the Page. See get_page_templates(). page-{slug}.php – If the page slug is recent-news, WordPress will look to use page-recent-news.php page-{id}.php – If the page ID … Read more