- This topic has 12 replies, 2 voices, and was last updated 6 years, 8 months ago by Tom.
-
AuthorPosts
-
July 29, 2017 at 10:35 am #356741Emran
My setup is EL+Pro+GP+GPP.
I made 2 template in Elementor LIbrary. Then added those shortcode to slider content. When the slider template added directly to Page, it works. But when I added it IN Page Header (GPP 1.4 rc1), it only execute first level shortcode.
How I able to solve that??
Page Header -> [slider template] -> [slide 1 Template] & [slide 2 Template]
In this format, slide 1 and slide 2 template are not working.
Demo URL: http://50.28.105.70/~toassess/
Here same slider template added as Page Header and below page header.
Emranul Hassan
July 29, 2017 at 11:45 pm #356939TomLead DeveloperLead DeveloperHi there,
So if the slider shortcode is added into the page header, and the slider shortcode has an Elementor shortcode, the Elementor shortcode doesn’t execute?
July 30, 2017 at 1:04 am #356952EmranThanks Tom for quick reply.
Slider Shortcode executed properly. But In each slide, I added elementor shortcode as content, which do not execute.
Here is the image for your reference.
Here is Source Code, where shortcode placed in individual slide do not execute properly.
If you require, I can give you wp-admin access.
Emran.
July 30, 2017 at 10:25 am #357111TomLead DeveloperLead DeveloperThis might be an issue with the Elementor text field not executing shortcodes. Have you checked with their support?
July 30, 2017 at 7:06 pm #357313EmranThanks for your reply.
I tested same slider shortcode in Elementor Shortcode Element and Text Editor Element. It works perfectly.
But when I add same shortcode in Page Header and GP Hooks, it only execute first level Shortcode, nested shortcode do not executed.
Any suggestion?
Emranul Hassan
July 31, 2017 at 12:09 am #357370TomLead DeveloperLead DeveloperI’m not really seeing how the Page Header is coming into play within the above scenario? I see an Elementor shortcode inside a Slides field inside Elementor. When does Page Header enter the picture?
From a coding perspective, the content inside the Page Header is ran through the
do_shortcode()
WP function – that’s the core way of executing shortcodes.July 31, 2017 at 12:31 am #357377EmranI wanted to make that Slider as Page Header in Homepage, so that I can do some customization on Navigation and to make Navigation over the Slider.
It also not works in GP Hooks.
I can do that in different way, adding elementor section below navigation then adding negative margin and navigation background as transparent. But then I am missing lots of customization you offer in Page Header for Navigation color/background etc.
I think, I am unable to make the scenario clear to you. If wp-admin access helps you to understand better, I can provide you admin access.
July 31, 2017 at 1:19 am #357391EmranActually I made it work adding a Filter Hook in your Page-Header.php and additional filter to do do_shortcode of Header COntent.
So please inform us, what filter you use to output content of page header. It will solve my issue.
Thanks.
Emranul Hassan.July 31, 2017 at 9:45 am #357607TomLead DeveloperLead DeveloperWhat’s the
iwebw_additional_shortcode
filter?If you look lower to where the content is out, it’s wrapped in the do_shortcode() filter. According to WP, that’s all that needs to be done in order to execute shortcodes.
July 31, 2017 at 9:57 am #357618Emraniwebw_additional_shortcode
I just experimenting some alternatives to solve my issue.Yes. I saw the code has do_shortcode filter wrapped in $options[‘content’].
My situation is like [shortcode1] some content [shortcode2] some content [/shortcode1].
Everytime, shortcode1 is executed, but shortcode2 is not executed.
So I need to pass the content of shortcode1, one additional do_shortcode filter to execute shortcode2.
Sp please could you please tell me how I can hook into page header content, specially $options[‘content’], so that I can add additional filter to get my desired output.
July 31, 2017 at 10:36 pm #357880TomLead DeveloperLead DeveloperWhat you’re trying to do isn’t something I imagined would be necessary at any point, so I’m not 100% sure it’s even possible.
One possible solution:
add_filter( 'generate_page_header_options', 'tu_alter_page_header_content' ); function tu_alter_page_header_content( $options ) { $options['content'] = apply_filters( 'iwebw_additional_shortcode', $options['content'] ); return $options; }
July 31, 2017 at 11:29 pm #357896EmranThanks for your support.
1. I deleted the additional line of code I added in page-header.php.
2. I added the following modified code as per your suggestion and it works fineadd_filter( 'generate_page_header_options', 'tu_alter_page_header_content' ); function tu_alter_page_header_content( $options ) { $options['content'] = do_shortcode( $options['content'] ); return $options; }
Thanks. Have a nice day.
August 1, 2017 at 12:42 am #357919TomLead DeveloperLead DeveloperVery strange as the code does that for you anyways on output.
Either way, glad it’s working for you now 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.