Would it not make more sense to use get_template_part() ? What may be happening is that there is no 404 template:
if ( '' != get_query_template( '404' ) ) include( get_query_template( '404' ) );
http://codex.wordpress.org/Function_Reference/get_query_template
This may be because pretty permalinks have been turned off, or because there is no 404 page template to be found.
The same is true of your get_page_template:
- You called query_posts but you did not call wp_Reset_query afterwards
- get_page_template must be called within the post loop, yet there is no post loop to be found
- you have the ID, it would be far easier to do a
get_post_meta($ft_wpecards_parentpost,'_wp_page_template',true);
to grab the page template filename, prefixed with the theme folder url
Related Posts:
- Error Warning: Declaration of description_walker::start_el after PHP upgrade [duplicate]
- Mega Menu Walker
- Displaying Logged-In User Name in WordPress Menu
- Autoloading in Child Theme
- How to add a class to the attachment images
- How to correct schedule my event weekly with wp_schedule_event()
- Execute a shortcode when clicking on a image
- add_rewrite_rule with bottom priority doesn’t handle the WordPress pages
- Successful or Error Message after running mysql code in functions.php
- How can one utilize a variable as a callback function name for add_settings_field
- Change logo based on incoming domain
- Count the number of times the search form template gets included on a page
- PHP code inside shortcodes
- How do I display a user’s previous orders as a select box option on a product?
- Adding Default Settings to Theme My Login plugin
- Remove meta description on certain pages
- Image media upload metabox
- How to combine wordpress_logged_in cookies in one cookie?
- Two Different Links for Same Product – WooCommerce [closed]
- Woocommerce related product text
- esc_html_e() is not translating string in wordpress [closed]
- WordPress Gravatar filter is removing my custom attributes
- Incorrect amount of posts returned when filtering related Woo products by custom taxonomy
- Limit 1 global comment per minute
- Modify custom field input data before creating a new post
- Remove echo from shortcode
- Is there a way to conditionally check whether a WordPress post title is empty?
- Copyright info change – Corporate Plus Theme PHP [closed]
- Inject class in body when particular page template is used
- Echo a function inside a function
- Use WordPress function in php file
- Get my site session in wordpress?
- How to list posts from a plugin taxonomy?
- wp_force_remove_style’ not found
- is_user_logged_in() not working in AJAX validation call
- Pagination on Custom Post
- Theme not calling Jquery properly
- WordPress redirect redirecting too many times or not at all
- how to save checkbox data for custom setting?
- How to keep the capability of users and disable Gutenberg editor in WordPress?
- Add product to cart for user – WC()->cart->add_to_cart [closed]
- How to create a field in customize and show that in header.php?
- Enqueing External JS on the remote server JS
- iframe not showing in content on blog page
- Need to Modify a WordPress Shortcode with another wordpress shortcode
- Get the name of menu item with wp_nav_menu
- How to add aria role and schema markup to custom walker container
- PHP Output also in Child theme, but different
- Remove submenu item from list
- Customize field names in backend profile edit page through function.php [duplicate]
- Insert content into head tag with function
- User filter posts by year
- bp-custom.php is not working on a WordPress multisite environment. how to fix it?
- Getting text from custom field from customizer
- Time Delay a URL Redirect for Specific Page
- Isn’t Returning Value While Using SELECT COUNT(*) FROM {$wpdb->prefix}
- Need help for some PHP code
- Adding wp users ID into a link address from a DIVI modul
- Execute function only for specific user roles
- Limit Search to Product Pages only unless I’m on Blogpage or Blogposts
- WP query posts BUT show the most recent and one per author
- Block error message in foreach loop when looping through ACF field
- Include User ID in iFrame URL
- Run a sql (update) after 12 hours after the user login. Woocommerce users
- Wp_Schedule_Event every few minutes doesn’t work
- File from parent theme imported to child theme doesn’t work – any ideas?
- Problem with displaying CSS Stylesheets – Am I adding them correctly in my wordpress child theme?
- Outputting post content to jQuery .html() string
- shortcodes, custom php and their errors
- register_block_type is not working properly
- In a foreach loop, how can I add a meta value if it doesn’t exist?
- cURL needing to loop through all “next_page”
- How to center all text body in single.php at once?
- Access WP files on “server 1”, from “server 2” – using wp-load on an external website
- How can I get my pagination loop to display the correct number of total pages?
- Get posts by id using shortcode
- Remove node from multisites?
- How to include a function in a template with template tag
- wordpress all post filter by year
- How to add custom text near category/tag title in WordPress Twenty Fifteen Theme?
- Show post/page into div using function
- How do I get the featured post to share on Social Media and show on Individual Post pages?
- Pulling a variable into the wp_nav_menu function
- Popular Post Not Show
- Echo multiple tasks if a common function exists
- A Customizer checkbox control that sets the setting to “” or to “blank” and show() or hide() a color control
- WordPress – registering sidebar and adding a button directly after .textwidget
- WordPress adding in site URL to header links
- Pagination not displaying
- Setting WooCommerce currency programmatically
- Masking external links with internal link for member-only
- Shortcode to include PHP file, pass various parameters to include?
- Why can’t I include echo inside a variable? [closed]
- Assign new post author IF another user in custom field on post transition
- Create and publish a new post every Monday, listing the post titles and links to the posts published during the previous week
- How do I change the Go To Categories link in the term_updated_messages
- WooCommerce – Show ‘Sales’ badge on variable products where only some variations have sales price [closed]
- Alternative to php echo within code
- Add multiple HTML attributes to an Elementor button
- /page/2/ redirect to 404