How to display the content HTML of a page without displaying the gallery code as well
I may be misinterpreting you, but I think what you want to do is run through strip_shortcodes
$page_data['content'] = strip_shortcodes($page->post_content);
$page_data['content'] = apply_filters('the_content', $page_data['content']);
Alternately you could conditionally hook that function to the_content
as demonstrated on the Codex Page.
Related Posts:
- Why is javascript allowed in my post content?
- Insert Custom HTML After Shortcode
- add_filter and changing output captions of image gallery
- Using variable from one filter in another filter
- Change default settings used by gallery shortcode
- Ajax, filters and shortcodes
- Format content value from DB outside of WordPress filters
- How to filter ‘post_gallery’ after all other filters/plugins etc
- How do I filter title and alt attributes in the gallery shortcode?
- Where is the content cache when using apply_filters(‘the_content…?
- WP Filter to change the URL of an Anchor wrapping the last gallery image
- How to filter post content and force every link () made in blocks to return urldecode() with readable value?
- Add Lightbox To WordPress Native Gallery
- add img class to native wordpress galleries
- Is it possible to override the default Gallery Settings form?
- get_post() containing gallery is outputting an unmatched closing div at the end of the content
- Can I override the content array using the_posts filter?
- Stripping URLs & Email from post submissions
- Get_template_part inside filter?
- custom gallery filter with image caption as link title?
- Gallery stripped from excerpt of post
- Hooked into wp_get_attachment_caption to add content to the default description; not working for jetpack slideshow. Why?
- Add Index to Item in WordPress Gallery
- How to stop echoing gallery inside content?
- Add class to all parent elements inside the_content
- How to filter users on admin users page by custom meta field?
- Custom theme hooks / filters – passing arguments
- What params are available with the_content filter?
- How to hook wp_list_pages?
- Don’t replace “|” with Empty String (“”) when generating slugs from title
- Hook into admin post list page
- How to exclude/filter a tag from get_the_tag_list()
- Changing document title only on a custom page template
- Filter the blog’s title without using global variables
- user_has_cap filter allows edit but will not allow save
- Add filter to wp_dropdown_pages() or wp_dropdown_categories() – no select container?
- Hook different functions to the same filter conditionally OR Pass additional arguments to existing filter?
- Search results sorted by post types
- where to apply “apply filters” and other Sanitization Functions
- Add guid filter to attachment in media library grid mode
- Pass parameter to the upload_dir filter
- Filter or Hook to catch pre-rendering of post content
- check to see if hook is available
- Filter users by custom colum not meta key
- How to allow users to view pending posts of a specific custom post type?
- Remove filter callback: method in class
- add_filter(‘the_content’, ‘…’) stops pagination from working
- How can I exclude tags from category_rss function?
- How to remove SKU’s from ALL products in Quick View – already remove from each product page
- How do I use remove_action on an add_action that uses an array?
- Change the default 10-day expiration for the password protected pages cookie
- Add content as soon starts
- Access get_the_title() from ‘excerpt_length’ filter
- How can I change the language of automated Mails?
- How can I replace an oEmbed URL in post with actual embed HTML
- Replacing a deprecated filter ‘woocommerce_get_price’ with ‘woocommerce_product_get_price’
- How do you get specific tags from the_content?
- Add a filter inside an action init
- Add filter for specific post type only
- apply_filters with multiple args and multiple add_filter
- Avoid user registrations with specific email provider
- Should I remove_filter in order to replace a filter?
- How can I specify the post status of an untrashed post?
- filter hook to load a different post/page on current post/page
- How would I be able to use a font awesome icon as a user’s avatar?
- Rewrite rule and display of post
- add_filter the_content doesn’t work
- Redirect to woocommerce checkout after adding to cart – item already in cart
- Passing variable from child theme function to parent theme filter
- `authenticate` filter never gets called
- paginate_links() Change the order of links
- Add Filter – Pass Variable (PHP < 5.3)
- How to disable a wp filter in a certain admin panel page
- Is there a filter to programmatically change the HTML tab switching output of the page editor?
- Why does admin_body_class not work?
- post_orderby filter breaks function
- Disable Remember Me in Login Form
- How do I add a line break to a string that is output by PHP?
- Counting a WP_Post Object value in an arary, using a filter?
- How to track a particular page in order to address the loading speed issue
- List all categories that have results in a query
- Distinguish between page and post in function
- Display posts from today and future in Elementor ‘posts widget’
- How to filter page title for certain page?
- Displaying posts on a page that have been assigned a value in a database
- Replace Text with hyperlinks
- adding an action inside if condition not working
- Adding filter to an specific page/site direction
- How to filter wp_get_recent_posts() to only posts that have thumbnails?
- How to check which submission button was clicked?
- check, if any “add_action” function contains string XXXXXXXXX
- remove_action conditionally for Custom Post Type – not working
- wp_get_attachment_link filter not working
- How would I remove an inline googleAPI font script in the the parent theme header.php?
- Joining tables not working in the post editor page
- Getting entry ID from frm_email_message filter in formidable
- Auto append text after the title?
- Is there a hook or filter that adds a button to the left of the search box?
- Filter and manipulate the get_current_user() function
- add_filter(‘the_content’, ‘method’) does not trigger my custom method