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:
- Custom single template for a specific category
- How to insert a logo in the header?
- 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?
- 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?
- How can I see what template parts are being called for rendering the viewable page?
- Problems with Layout inherit in theme.json
- How to Handle CSS for Multiple Header header.php Files?
- Responsive class to all the images in the content
- Static Front Page problem
- 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]
- 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?
- Disable front-page.php template
- How do I create a custom partial / template?
- Change the template of multiple multisite pages at the same time
- 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?
- Override template file i subfolders
- Single Page theme [closed]
- Single page site with history.js
- Do i need to keep all the default WP templates files in a theme?
- how to display search term in the template full site editor
- Sort wp_query by sum of two meta fields
- How to override p2 breathe theme plugin in content template file?
- Move default page templates to sub directory
- What can I use for small text when converting to WordPress?
- WordPress Filtering Custom Post Type by Metadata and Search Heirachy
- How to place HTML tags in content from the_content()?
- The Content is not Wraping in tag
- Is there any tool to find lines of codes responsible to generate front-end HTML elements?
- How do I get the trackback count of a post in wordpress without writing an SQL query?
- Load sidebar template just once to prevent multiple animations
- Edit value of the_content() before showing
- Unique design inside a specific category’s url
- Broken theme, template is missing
- Why tags are displayed bellow the content and not inside
- How to add menù section to my WordPress template?
- How to add custom meta box when you have a custom page template file
- Password protect a custom template
- Single.php the_excerpt loads same as the_content not loading read more line
- Shortcode call not working in WP Template
- WordPress Load Only Page Text
- Load different single.php templates according to post layout selection
- Create theme for mobile phones and tablets only?
- $_POSTing to and modifying the WP search results page
- Confused by the behaviour of “front page” / “home” templates
- Custom theme won’t use search.php
- How to create a WP theme that use BootStrap? [closed]
- How to link to the page displayed by home.php?
- Search Form Not Working
- altering search terms
- 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
- Using wp_add_inline_style Inside a Template File
- Different templates for each category level
- Child theme in separate WordPress Install
- How to show children pages as array
- Display content on Single page
- Strip HTML tags on custom code from the_content
- WordPress Custom Search By Alphabet and order by asc and sesc
- Incorrect search results in search.php – issue triggered by using `define(‘BodyID’, ‘search’); the_post();` in search.php
- Problem with multiple menus in theme
- Enable WP to accept standard jQuery code embeding between the tags [duplicate]
- Confused on loading page content
- Search Results not displaying for multiple word search
- 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]
- 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