If your video is pasted into the post body, you have a couple of options.
- Use a filter on
the_content
andpreg_replace
to remove the content. - Wrap your content in a shortcode.
I am going to recommend option #2 because option #1 involves processing markup with regex which is tricky and prone to error, and your question does not contain enough information for me to be able to write that anyway.
function hide_on_home_page_wpse_97587($atts,$content) {
if (!is_home()) {
return $content;
}
}
add_shortcode('nohome','hide_on_home_page_wpse_97587');
Then when you post content put the switched content between [nohome]
and [/nohome]
Related Posts:
- Stop WordPress Wrapping Images In A “P” Tag
- Stop WordPress automatically adding tags to post content
- Keep featured content post in homepage with original order
- Get content from one page and show it on another page
- Strategy for handling hierarchical pages with empty parent content
- How to remove Nextpage tag inside posts text depending of utm_campaign
- Template file for static posts page does not get loaded?
- How can you make sure authors’ posts are longer than 250 words?
- What is the best / efficient way to get WordPress content by post id and why?
- How can I display 7 posts on the home page, but 9 posts on the subsequent pages?
- JSON not valid after json_encode posts
- how to display full post with pagination on home page
- Add default content to post (for specific category)
- Programmatically inserting page breaks
- How can I specify a category post on my home page
- Filter/Remove HTML Elements on all posts and pages
- Show post titles only on the homepage
- Paragraphs removed when using get_post_custom()?
- Load post content into div with ajax
- Displaying Page Title on index.php
- Linking to page with all posts
- Testing for post title in ‘if/else’ statement returns no content
- How to link up “read more” on excerpts hack from WP Recipies
- Same content shared between multiple posts?
- how load content as pop-up using ajax
- Can I set and show “important” post in my blog?
- How to get only text from wordpress post content?
- How can I remove posts of a certain category from homepage after a specified time period?
- Batch process: remove first image from post content
- How to make the post summary taller?
- Why content_arr[‘extended’] removes paragraph tags?
- Static page does not show my posts
- Limit posts per author role (excluding admin) in home page
- Properly display posts on homepage
- Best way to assign post position in a news site homepage? (no categories, no sticky posts)
- Unautop / Sanitize content added to a post through a plugin
- is there a way to show the the post title after the image?
- How to get rid of shortcodes in post content once and for all
- Add Word Limit to Posts
- How to show last post of each website of a MU wordpress in HomePage
- Move first half of posts to one parent page, second half to the other page
- How do I display some posts fully on the homepage, and some as an excerpt only?
- Editing the default page to show all posts, rather than most recent ones
- Show only one page link in content pagination
- Show only posts with images and a fixed amount of posts
- How to create new post content templates for my users?
- How do I do a page break?
- How to get a post’s content? [closed]
- Hide posts belongs to few categories in homepage
- What file is the standard frontpage that lists all the posts?
- Why does a published post only displays the title and not the content in the site? [closed]
- How to Use index.php file for “Blog” Page And this is Not a Home Page
- Loop doesn’t exclude the specified category in home page
- Best Way to Add UnEditable HTML to Posts
- Single Post in Tab/Slider
- The_excerpt() doesn’t parse – how to change that?
- Getting Duplicate Posts on Home Page with Widget Added Between Posts
- Page and post loop same template
- Benefits to using semantic HTML in post content? [closed]
- Add hero image to home page (blog format) via the dashboard
- Custom home page with full post for first one only
- the_content() Not Grabbing All Content
- Inserting an example of the last 3 post on to the homepage
- I don’t want the complete article to show on homepage
- Can’t save WordPress post with “/etc/” in it
- content summary of a post disappears If an images added at the beginning of the post. how to solve it?
- Post is in descendant category not working in home.php
- How do I set content in my pages so that it remains permanent while blog posts are added below?
- Nothing appears using get_the_excerpt() in category.php
- WordPress each user has each content for a page,how to do that?
- Add caption to thumbnails in content
- Adding div to WordPress page content
- How to remove related post from home page
- Post as frontpage – avoid duplicate content
- Link post to blog from a static page
- Adding editable content above posts
- How to get post_content while the post is being edited
- Custom template for different post types
- Correcting the content width when sidebar is inactive?
- Multiple approval from editors before publishing?
- 404 error on every post and page other than home
- Get part of a page url
- Trying to display stick or featured post on homepage
- How can i show only 30% of the “the_content(“More…”)”?
- How to use wp_editor(); in functions.php then retrieve content in the template
- Home page: using custom fields for posts and pages
- Add default content to post (for specific category)
- jquery: getting contents of #content field on post page
- Stripping tag from elements in post
- How to have more post in a page than in your home page
- What does WordPress mean by they have full rights to content [closed]
- After the local installation of an old WP website I can see the homepage but I can’t access to the articles, why?
- wordpress pinboard theme [closed]
- Automatically search and replace link in content (pages/posts)?
- Display content from specific category
- Notify/check if the content of a custom gutenberg block has changed on save_post
- How to display breadcrumb on category?
- Add text/link next to the last word of each post
- Is it possible to create dynamic templates for block themes directly from the site editor?
- How to specify a post category for the home (posts) page?