Load Gallery Images with Title on Homepage BX Slider

I would recommend using this plugin instead: https://wordpress.org/plugins/cpt-bootstrap-carousel/ It works well with the built-in Twitter Boostrap 3 in Roots.oi theme (Responsive) and it comes along with a CPT named carousel. Looking in your code: The get_post_gallery_images() function only returns the url and it doesn’t contain any Gallery Image Title content.

get_pages() Returns Only One Item

Your problem is in this section foreach( $voc_pages as $voc_page ) { $voc_link = ‘<a href=”‘.get_page_link( $voc_page->ID ).'”>’.$voc_page->post_title.'</a>’; return $voc_link; } You return $voc_link after just the first iteration, stopping the function and returning its value. You should take return $voc_link; outside your foreach loop, and probably save your links as an array Change the … Read more

Syntax error in a shortcode function

You need to escape your quotes, or use doubles, or use heredoc: // Escaped return ‘<div id=”xxxx-xxxxxx”></div> <script type=”text/javascript”> window._taboola = window._taboola || []; _taboola.push({ mode: \’xxxxxxx-xxxxx\’, container: \’xxxxxx-xxxxxxx\’, placement: \’one word word\’, target_type: \’mix\’ }); </script>’; // Doubles return ‘<div id=”xxxx-xxxxxx”></div> <script type=”text/javascript”> window._taboola = window._taboola || []; _taboola.push({ mode: “xxxxxxx-xxxxx”, container: “xxxxxx-xxxxxxx”, placement: … Read more

Shortcode not getting replaced

Shortcodes get replaced when you output the content via the_content() function, or apply the filters hooked to the_content. If you look at raw post data, you will always see the original shortcode placeholder, that is normal and expected.

How to trace shortcode to its functionality

What I always do is, I search the files… So I use the “Search in files”-function in Notepad++ (which I am using) and limit the search to the directory, where I think, I will find what I am looking for. So, probably, you know already the plugins directory. You enter this information into the folder … Read more

Create a shortcode to use in visual editor

Simple, make a shortcode: function my_image() { $image = get_field(‘imagen_superior’); if( !empty($image) ) { echo ‘<img src=”‘ . $image[‘url’] . ‘” alt=”‘ . $image[‘alt’] . ‘” />’; } } function my_shortcode( $attr ) { return ‘<div class=”header-image”>’ . my_image() . ‘</div>’; } add_shortcode( ‘my-shortcode’, ‘my_shortcode’ ); and then place [my-shortcode] in the visual composer.