Tagged: do_shortcode
Hi,
I need to personalize some loops like loop-about-author or loop-index, adding some special heading, text hr etc.
I’d want to use the code and style of Enfold theme to create html elements. I noticed that each element has its own class and the common method shortcode_handler() where its arguments can be understood looking the builder settings.
The problem is that creating some element’s class object it generates error because the constructor requires some unknown parameters.
Sometimes, instead, calling the method shortcode_handler() as a static methods, it works but also requires the $meta parameter and so it throws a notice.
Is this the correct way to use Enfold functions to retrieve html/css code ?
Which is the best way to personalize some loops or create dynamic custom pages (eg, show the list of authors, in a beautiful way, with its avatar, name and description)
Thank you
Afaik shortcode_handler() is not a static method but every shortcode class extends an abstract class (aviaShortcodeTemplate in shortcode-template.class.php) and you also can’t call shortcode_handler() like a static method. However you probably don’t need to cope with all these things anyway and you can use the standard do_shortcode() function: http://codex.wordpress.org/Function_Reference/do_shortcode to embed your shortcodes into the templates/loop files.
Yeah, the method isn’t static but php let you also call it in that odd way without giving errors !
This is what I was searching for, I didn’t know the do_shortcode(). I’ll try it, thank you!
Hi danielebr,
That should allow you to use any of the shortcodes in page templates without issue.
Regards,
Devin