Filtering Pages and Posts for shortcode

AI-generated summary

The discussion revolves around filtering pages and posts for a shortcode. oldManLemon is trying to publish full post content to a Discourse forum using the Avada theme, but encounters issues with shortcodes. simon suggests publishing an excerpt of the post and allowing users to view the full post by clicking a button, which should properly render shortcodes.

However, oldManLemon experiences issues with the “Show Full Post” button, which gets stuck on loading. simon offers to help troubleshoot the issue if oldManLemon can share a link to the post. Since the site is behind a firewall, oldManLemon shares the console error instead.

simon suggests that the firewall might be causing the problem and recommends creating custom excerpts for posts or deselecting the WP Discourse Use Full Post Content option. Alternatively, code can be added to hook into the WP Discourse wp_discourse_excerpt filter.

I am currently trying to use post full page/comment to the discussion area of my forum. I have chosen to do this because I we are using Avada theme which comes with pages builder.

[fusion_builder_container hundred_percent=“no” equal_height_columns=“no” menu_anchor=“” hide_on_mobile=“small-visibility,medium-visibility,large-visibility” class=“” id=“” background_color=“”

See above ^^^

I was wondering if there is a filter file somewhere that i can begin to enter this short code into the filter to remove it?

Shortcodes are a real problem if you want to publish the full post content. Take a look at the Dealing with WordPress shortcodes section of this topic for a few ways of dealing with them: WP Discourse plugin tips and tricks.

The easiest approach would be to publish an excerpt of the post to Discourse and then allow users to see the full post by clicking on the Show Full Post button. When that is done, the shortcodes should be properly rendered in the expanded post.

Yeah I just noticed in my trails and tribulations that it seems to filter well in this case. The reason I was trying to avoid it was because if you click show full post it just changes to loading and never gathers to the full post. I was thinking that might have something to do with the shortcodes. Do you have any suggestions?

It would be good to sort out what the problem is with expanding the posts. If you can share a link to a post on your WordPress site, I’ll take a look at it. You can either post a link in this topic, or send it to me in a private message.

I unfortunately it is behind a firewall as it is for an internal company. I can route it to a different address to face it outwards temporaily. Would that bother installation if its address changed?

Unprocessable Entity s@http://forums.bornhorstward.com.au/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:14:28648 o@http://forums.bornhorstward.com.au/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:14:28505 i@http://forums.bornhorstward.com.au/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:14:28434 trigger@http://forums.bornhorstward.com.au/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:19:5881 _onError/<@http://forums.bornhorstward.com.au/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:19:7862 invokeWithOnError@http://forums.bornhorstward.com.au/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:7:19387 flush@http://forums.bornhorstward.com.au/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:7:19832 flush@http://forums.bornhorstward.com.au/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:7:20592 end@http://forums.bornhorstward.com.au/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:7:20937 run@http://forums.bornhorstward.com.au/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:7:22006 u@http://forums.bornhorstward.com.au/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:13:2804 e/i.error@http://forums.bornhorstward.com.au/assets/application-d7d9fb49f298a259400f291dd8ed234f2b5ec1bf52d2ea22551bae7d0118ae13.js:7:7055 c@http://forums.bornhorstward.com.au/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:2:7300 fireWith@http://forums.bornhorstward.com.au/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:2:8054 r@http://forums.bornhorstward.com.au/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:3:11484 n/<@http://forums.bornhorstward.com.au/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:3:16331 [_ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:29446:6](http://forums.bornhorstward.com.au/assets/_ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js)

XML Parsing Error: syntax error Location: http://forums.bornhorstward.com.au/logs/report_js_error Line Number 1, Column 1:

That is the error in the console when I click expand. Let me know if you still want me to get the site pointing out to the real (scary) internet?

This might be what’s causing the problem.

The easiest solution in the short term would be to create custom excerpts for the posts that you publish to Discourse and deselect the WP Discourse Use Full Post Content option. If this isn’t possible with the Avada theme then some code will have to be added that hooks into the WP Discourse wp_discourse_excerpt filter.