The problem in your code is that your function is only returning the content when is_page()
is true, which is not on the default search results page, where is_search()
is true. Likewise, the content would also not be returned on singular post pages and anywhere where is_page()
is not true.
So remember that a filter callback (like your themename_iframe_wrapper()
function) must always return the content, just as with shortcode handler functions.
function themename_iframe_wrapper($content) {
if( is_page() ) {
... your code.
return $content; // don't just return it here
}
return $content; // always return the content
}
Related Posts:
- What’s the difference between home.php and index.php?
- Custom single template for a specific category
- How to insert a logo in the header?
- How to remove search bar from a wordpress theme? [closed]
- Are content.php and content-single.php the same?
- How to move page templates to custom folder?
- Page template in two level deep folder
- Is it possible to manipulate the list of page templates?
- Different wordpress 404 template for different post type [duplicate]
- How does WordPress decide what template to use as frontpage
- How can I get wp_head() as a string instead of echoing it?
- Why does my short code get executed before other content?
- Retrieve the template directory URI via global or get_template_directory_uri() every time?
- How can I see what template parts are being called for rendering the viewable page?
- Add a preview to a WordPress Control Panel
- Add a #hash to the links in my custom menu
- Problems with Layout inherit in theme.json
- How to Handle CSS for Multiple Header header.php Files?
- How to load different CSS in different Header?
- Responsive class to all the images in the content
- Static Front Page problem
- Adjust the results quantity for Search Results page pagination
- Returning Variables back into a template
- Can not Remove Archives and Meta from Sidebar
- How to hide and content from auto-generated excerpts?
- How to override BuddyPress 3.0 bp-nouveau theme files?
- the_content() in single-{post-type}.php problem
- wp_enqueue_scripts not called on search page?
- Setting hero/splash section as a blog post
- Where is the correct place(s) in twentysixteen’s header.php to add a Google webfont?
- How to retrieve an image from a post and display it before excerpt of a post? [duplicate]
- Any tag pagination page (except the 1st page) loads index.php template instead of tag.php
- How do I update WooCommerce template files in my theme? [closed]
- How can I customize wp_footer, where is the code that controls what this function does?
- New template, where to place CSS?
- Check if password protected post is visible
- get_query_var() and permalinks
- What is the best way to handle multiple calls to get_template_directory_uri() and similar functions?
- Toggle Sidebar Display
- Add theme templates for child categories into the template hierarchy
- Move theme templates to subfolder without losing page associations
- Where can I access my custom page template?
- Theme development question regarding layouts
- Why are theme templates organized as multiple point of entry PHP files instead of reusing your theme’s index.php?
- WordPress Theme Development: How to redirect templates the right way?
- Disable front-page.php template
- How do I create a custom partial / template?
- Change the template of multiple multisite pages at the same time
- Implement advanced search
- Load child template based on parent
- Why is the post type on the search result page random?
- Non-Blog Website without Search: are comments.php and search.php in theme still required?
- create-guten-block in wordpress theme?
- Custom WordPress Theme – Search not working on posts
- Override template file i subfolders
- Single Page theme [closed]
- Displaying recent post excerpts on static front page
- Single page site with history.js
- Stop WordPress from showing images on non post pages
- altering search terms
- Is there a template tag I can use to link to the archive page corresponding to the month that a post was published on?
- Custom search template is showing 404 when adding query string
- Woocommerce AJAX filters option loading spiner – problem on mobile device
- How to Modify WP_Includes/blocks/latest_posts.php
- Why not works the search.php file?
- Getting post URL within custom content template
- Is it possible to show sort page excerpt in search.php
- How to implement pagination in category.php template
- Template for front page (latest posts)
- Using wp_add_inline_style Inside a Template File
- which template should I use for single category post?
- Should I use template files or just use conditional tags in index.php?
- Different templates for each category level
- Child theme in separate WordPress Install
- How to show children pages as array
- Display content on Single page
- New theme HTML5 Support for Search in WordPress 4.4
- Create a variable with string, array or multiple values
- Strip HTML tags on custom code from the_content
- Using require_once for parent-directory not working but is working in sub-directories
- WordPress Custom Search By Alphabet and order by asc and sesc
- How can I fix the even/odd child classes comments so that the comments are unaffected by the top-level even/odd?
- Incorrect search results in search.php – issue triggered by using `define(‘BodyID’, ‘search’); the_post();` in search.php
- Problem with multiple menus in theme
- Suppress the_content filter in a nested loop
- Enable WP to accept standard jQuery code embeding between the tags [duplicate]
- The normal loop with different styles doesn’t work in search.php
- Confused on loading page content
- Search Results not displaying for multiple word search
- What is the advantage of using home.php over index.php for the front page
- Best practice to create required pages
- custom theme’s search not working
- How customizable is a self-hosted WordPress blog compared to a Blogger blog?
- What is the point of using the front-page.php template? [closed]
- Meaning of “if ( is_home() && ! is_front_page() )” snippet?
- What is the point of using archive.php instead of index.php?
- Theme template file for a specific custom taxonomy
- Return the_content() with custom div class for a subset of posts
- How to create a template for a post in Query Loop block?
- Twenty Twenty-Four Theme, where to put the personalized CSS style rules?