Tagged: Nikko
-
AuthorPosts
-
November 17, 2016 at 5:01 pm #713649
Hi Enfold team
I’m talking about that: http://kriesi.at/documentation/enfold/add-new-or-replace-advanced-layout-builder-elements-from-child-theme/
You said: “You can also add new ones using the other shortcode elements as examples.”
> I do not understand that (I’m not enlgish)I have override one of you AVIA element: postslider.php (My postslider.php is in my /shorcodes child theme folder and it works BUT it also override the original one, so : how can I create a new shortcode based on postslider.php that will not override the one of enfold ?)
PS: before submitting a ticket here I have tried a lot of thing within this file, like, renaming the file to my-postslider.php and do some modifications in the file like this:
if ( !class_exists( 'my_avia_sc_postslider' )) { class my_avia_sc_postslider extends aviaShortcodeTemplate { /** * Create the config array for the shortcode button */ function shortcode_insert_button() { $this->config['name'] = __('Post Slider', 'avia_framework' ); $this->config['tab'] = __('Content Elements', 'avia_framework' ); $this->config['icon'] = AviaBuilder::$path['imagesURL']."sc-postslider.png"; $this->config['order'] = 30; $this->config['target'] = 'avia-target-insert'; $this->config['shortcode'] = 'my_av_postslider'; $this->config['tooltip'] = __('Display MY Slideshow of Post Entries', 'avia_framework' ); $this->config['drag-level'] = 3; }
thanks
November 21, 2016 at 12:35 pm #714778Hey pako69,
Do you have this code in your child theme’s function.php?
add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1); function avia_include_shortcode_template($paths) { $template_url = get_stylesheet_directory(); array_unshift($paths, $template_url.'/shortcodes/'); return $paths; }
If you already have it, you just need to create a folder named shortcodes in your child theme then paste in your my-postslider.php. Hope this helps.
Best regards,
Nikko- This reply was modified 8 years ago by Nikko.
November 21, 2016 at 12:54 pm #714784Hi @Nikko
Yes I have it since a long time and yes I also have a file called my-postslider.php in my child them /shortcodes/ folder (read my question: I have said that)
My own shortcode (my-postslider.php) works but IT OVERRIDE the one from Enfold: I would like to use both of thoses shordcode :
– My own
– The one that come from EnfoldNovember 21, 2016 at 1:16 pm #714790Hey!
Can you give us temporary admin access? so we can inspect it further.
Cheers!
NikkoNovember 21, 2016 at 2:51 pm #714825Yes maybe on a developpement server, not the production server and only if french language don’t afraid you :)
November 21, 2016 at 3:06 pm #714831Hi!
Yes, that should be good atleast we can inspect and check if there’s missing why it’s not appearing.
Regards,
NikkoNovember 21, 2016 at 3:12 pm #714833I have never said that my own shortcode do not show up! It does… I said: “it works”…
Do you understand what is my problem or maybe my english is not enough good?November 21, 2016 at 3:34 pm #714841Hey!
Sorry if I misunderstood the question, I probably forgot some of the details when I saw your code above which uses same name Post Slider. Just to confirm I understood the issue properly, you have 2 post sliders, one comes with enfold and the other one (my-postslider) is modified by you, the modified version works fine but the when trying to use the original version the modified version is what is executed (since the modified version overrides the original), is this right?
Can you try to post your whole code for my-postslider.php in http://pastebin.com/index.php and give us a link to it. So we atleast check the code. I might be able to reply on this tomorrow since it’s a bit late now.
Regards,
NikkoNovember 21, 2016 at 6:47 pm #714929November 22, 2016 at 9:26 am #715167Hey!
I have modified your code and it should be working properly and not overriding the one that comes from enfold: http://pastebin.com/JAQ6187v
Here are the changes I made, in line 245 this code:
), $atts, 'av_postslider');
I have changed av_postslider to my_av_postslider and all instances of avia_post_slider (total of 6) I have replaced with my_avia_post_slider. Let us know if it works properly on your end.Cheers!
Nikko- This reply was modified 8 years ago by Nikko.
November 22, 2016 at 9:51 am #715181@Nikko > your are my hero! Now it works.
joking aside, I think it will be great to explain how to do that there: http://kriesi.at/documentation/enfold/add-new-or-replace-advanced-layout-builder-elements-from-child-theme/
Thanks a lotNovember 22, 2016 at 10:16 am #715186Hi!
Glad we could help :) Regarding the documentation, I think it’s a related topic but it’s a bit situational, it’s better to keep it simple. :)
Cheers!
Nikko -
AuthorPosts
- The topic ‘Add new or replace Advanced Layout Builder elements from Child Theme?’ is closed to new replies.