Tagged: Accordion, custom, enfold, Shortcodes
-
AuthorPosts
-
July 6, 2014 at 8:19 pm #287764
Hi,
We use custom shortcodes like [image1] to show logos to companys we often write about. We need these small logos in the title on the Accordion but it dont work.
If you just put the regular code in the title field it shows up. But if we try the shortcode [image1] that output the code it dont work.
It removes almost the whole title and add this to the content:
‘ tags=”]Any ideas?
We have custom fuctions in our enfold child theme like hits:
function image1() {
return ‘‘;
}
add_shortcode(‘shortcode1’, ‘image1’);
The image shortcodes work well in other places.
July 6, 2014 at 8:21 pm #287765The code what was removed looks like this::
function image1() { return ‘<img src="URL">‘; } add_shortcode(‘shortcode1′, ‘image1′);
July 7, 2014 at 5:19 am #287831Hi!
Thank you for using the theme.
If I am not mistaken, you should use [shortcode1] not [image1] in order to call the shortcode function image1.
Cheers!
IsmaelJuly 7, 2014 at 8:26 am #287854Hi Ismael,
Your right, I just wrote it wrong here in the example. We use [shortcode1] on our site.
This shortcode works and output the image if I use it on the post or in the content bart of the accordion.
But when I use it in the title it dont work.
We have around 15-20 images that we use around 50-90 times every day so it saves us hours of manual work time to use these shortcodes.
July 8, 2014 at 12:03 pm #288433Hi again Ismael,
Did you find any way to be able to use shortcodes in the accordion title?
If not, any other fast way to always insert the same images in a fast and easy way?
July 8, 2014 at 4:54 pm #288598Hey!
Accordion titles do not support shortcodes by default. If you really want to use a shortcode in the title open up wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/toggles.php and replace:
if(empty($toggle_atts['title'])) { $toggle_atts['title'] = avia_sc_toggle::$counter; }
with
if(empty($toggle_atts['title'])) { $toggle_atts['title'] = avia_sc_toggle::$counter; } $toggle_atts['title'] = do_shortcode($toggle_atts['title']);
Regards,
PeterJuly 8, 2014 at 8:16 pm #288666This reply has been marked as private.July 8, 2014 at 8:17 pm #288667This reply has been marked as private.July 9, 2014 at 6:18 am #288848Hey!
Can you post a link to the page where you have these accordions and the image URL you want to include in the titles?
Regards,
JosueJuly 9, 2014 at 8:46 am #288880This reply has been marked as private.July 9, 2014 at 8:47 am #288882This reply has been marked as private.July 9, 2014 at 3:17 pm #289036Hey!
Where have you changed the file so far? Was it in the parent or the child theme?
Cheers!
DevinJuly 9, 2014 at 7:42 pm #289177This reply has been marked as private.July 10, 2014 at 2:55 am #289284Hey!
Check it now:
http://www.informatchen.se/preview/I was able to achieve what you want using CSS:
.custom_title:after { content: url(https://www.informatchen.se/wp-content/uploads/2014/07/check341.png); position: relative; top: 2; right: -3; }
The tab title in question is set as an span.custom_title:
Best regards,
JosueJuly 10, 2014 at 9:58 am #289379This reply has been marked as private.July 10, 2014 at 2:12 pm #289494You can use the same css technique but with various classes if the php file change isn’t working for you. So for each image you would have a different class (which is the same way the theme does the icon fonts icons on elements).
July 20, 2014 at 7:34 pm #293638This reply has been marked as private. -
AuthorPosts
- The topic ‘Custom shortcodes in Accordion title?’ is closed to new replies.