Page templates are called too late to effect actions. You can achieve what you need another way, by targeting this in your functions, with a test for the page template, like this:
function twl_content_wrap_start() {
if ( !is_page_template( "page_full-width.php" ) )
return '<div class="container">';
}
BTW, as a rule of thumb, actions generally don’t echo, they should return (although it does depend on the action).
Related Posts:
- Enforcing password complexity
- Check if a menu is empty?
- Can i check if user is doing any ajax request?
- Hooking new functions to actions + passing parameters
- Why do filters/actions require an argument count?
- page template for attachement page?
- How to access function from outside of a class within this class in WP plugin?
- How to use return in my custom function instead of echo
- Adding Default Settings to Theme My Login plugin
- add_action shortcut?
- Showing content from one page on another
- Populate editor with some content of a page with a page template
- Modify custom field input data before creating a new post
- Error call_user_func_array() expects parameter 1 to be a valid callback when using image_size_names_choose
- jQuery code not working when included in functions.php
- Inject class in body when particular page template is used
- Adding wrapper elements in the_date() like in the_title()?
- Override a function defined in wp-includes/comment-template.php
- Show meta box only for default page template
- Nested “do” and “add” Actions is possible?
- WordPress redirect redirecting too many times or not at all
- How to pass hook variable to function?
- Display additional page templates and a sidebar on plugin activation
- Contain multiple page templates in one PHP custom template file in WordPress?
- remove_action from parent theme using child theme functions.php
- Hook into all password resets in WordPress and get password before hashing?
- Unable to pass arguments to function used in add_action
- Calling PHP function doesn’t work in index.php
- WordPress HTML Helper
- Highlight posts currently being edited on multiple editor site?
- Display custom meta box in my template file
- Loop on a wordpress Page instead of content coming from the WP text editor
- Why a class property becomes empty?
- Is there a hook that I can use when a fatal error occurs?
- Execute wp_after_insert_post after the permalink is customized
- Allowed memory size of 268435456 bytes exhausted (tried to allocate 7146491840906359738 bytes)
- How do I get the author’s page url from their ID?
- How to check from which page the user is coming to the current page?
- Execute only on a certain page
- How do I know what variables are passed in a filter/action and what their meaning is?
- Wrap each shortcode in array to div
- Replace comment avatars and links at the same time
- Check if Product is in a Specific Category in Functions.php
- Adding ads code between comments
- How to Display Image Meta underneath EVERY image in EVERY post
- How to add custom post meta to default blog post?
- Limiting woocommerce line_total decimal length
- Shortcode content filter?
- Swapping wp_dropdown_categories function with wp_category_checklist
- Ajax – Call to undefined function get_option()
- only show container with next/prev links if they exist?
- JS file work only in index page
- Error in custom php function doesn’t exist
- Custom shortcode outputs plain text instead of HTML at top of post
- how can i use $_COOKIE[] + PostID to execute the below code?
- How to get the value of input hidden html from text editor to custom page template?
- Create Page To Count Comments For Each Post In WordPress Site
- Call to undefined function get_userdata() in plugin
- Echo string and function?
- Notify users only on post publish
- Plugin Generate Unexpected output during activation
- Editing a PHP file to include a small text piece on every page
- PHP code for displaying WordPress posts in a static page not working
- How to add data to a custom field at the wp_users table?
- How can I use custom menus with a Bootstrap WordPress theme?
- How to make a cookie be on the whole site instead of being on a specific page/
- Child Theme’s Read More Text
- call a string/function from database
- Get date function not working
- How to remove/hide collapse menu for user/subscriber?
- How to implement __() function in my theme’s php file?
- How a HTML form can trigger a PHP function?
- Get current user id in function php
- Proper way to remove html code on child theme
- Trying to add Custom Post Type to this functions.php command
- Apply function.php filter only if url not has /amp/
- Display a custom name when the user has no name settle in his account
- Discount in the specific product title using keyword ( Woocoommerce )
- Modify post image in full size
- How to link all featured images to custom url in single.php for only non-logged-in users?
- Menu to the right of screen on desktop using Bootstrap 4
- custom post type column countdown
- How to sort (orderby) a query done by a template function before the ‘foreach’ loop?
- Dropdown menu on custom menu
- How can the searchform.php know if it’s used on a registered sidebar id ‘sidebar-1’ or ‘sidebar-2’?
- WordPress get_post_meta issue
- Woocommerce Price Text
- Show custom default avatar instead of gravatar
- Display pages from specific page template
- ajax form function error
- Simple Probléme in wordpress
- Contact form with dynamic dropdown and filter
- Critical Error customiser
- Custom WordPress Function – Adding items from Foreach Loop into an array and Updating Field based on array of IDs (ACF + WooCommerce)
- Can I associate a custom post type with another custom post type?
- Creating posts with php-script + csv
- Change WooCommerce Order status from frontend form submitted data
- Show Login Errors In WordPress/Elementor (Code “works”, but breaks site)
- Add_filter just custom page types
- Hide or Show Read More Button by Content Area