Variable shortcode
-
Need a variable shortcode because I’m working with a page-builder (beaver builder) and the position of the colorpalette is at the bottom of the page instead of under the image… so I’m using this:
// Variable colorpalette function db_colorpalette( $atts, $content = null ) { $id = get_post_thumbnail_id( $postid ); echo do_shortcode ('[colorpalettes attachments="' . $id . '"]'); } add_shortcode('variable', 'db_colorpalette');
it works but I’m not sure if this is the correct code… also the colorpalette is now positioned on top of the page…
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Variable shortcode’ is closed to new replies.