How to store multiple instances of the plugin’s options for various shortcodes
How to store multiple instances of the plugin’s options for various shortcodes
How to store multiple instances of the plugin’s options for various shortcodes
I’ve finally found a working solution : function tag_cloud_shortcode($atts) { extract(shortcode_atts(array( ‘cat’ => ” ), $atts)); $query_args = array( ‘cat’ => $atts, ‘posts_per_page’ => -1 ); $custom_query = new WP_Query( $query_args ); if ($custom_query->have_posts()) : while ($custom_query->have_posts()) : $custom_query->the_post(); $posttags = get_the_tags(); if ($posttags) { foreach($posttags as $tag) { $all_tags[] = $tag->term_id; } } endwhile; … Read more
Some data has already been output, can’t send PDF file – fpdf issue in WordPress
Here is my solution: function getProductCarousel($atts) { $productIds = explode(‘,’,$atts[‘product_ids’]); ?> <div class=”col-center m-auto”> <div id=”myCarousel” class=”carousel slide” data-ride=”carousel” data-interval=”0″> <!– Carousel indicators –> <ol class=”carousel-indicators”> <?php $slide = 0; ?> <?php foreach($productIds as $index => $productId) { ?> <?php if ($index % 3 == 0) { ?> <li data-target=”#myCarousel” data-slide-to=”<?= $slide++; ?>” <?= $index … Read more
Look at below function function LoadNavigationFile($atts) { if ( ! empty( $atts[‘dirname_with_file’] ) ) { $dirname_with_file = $atts[‘dirname_with_file’]; } $str=include( get_template_directory() . $dirname_with_file ); }
I did a gallery pagination by converting all the stuff from galleries into arrays, and then json_encoding that and passing it to javascript. If you were to to that you could have multiple scripts: jQuery(document).ready(function( $ ) { var thisgallery = <?php echo the gallery; ?> function process pagination (){ code for pagination } } … Read more
How to use a shortcode of a plugin in another plugin php file
I’ve sourced the CSS from https://codepen.io/vram1980/pen/Kyaie all credit above. Putting it with your function, you can do something like this: add_shortcode( ‘linestatus’, ‘line_status_handler’ ); function line_status_handler( $atts ) { extract( shortcode_atts( array( ‘open_time’ => ’09:00:00′, ‘closed_time’ => ’17:00:00′, ‘open_text’ => ‘our lines are open’, ‘closed_text’ => ‘our lines are closed’, ), $atts ) ); $opened … Read more
Shortcodes are not a programing language, and anything that looks like something a non technical person will not be able to maintain, should never be created/used. Create one shortcode that does what you need. Since in any case a programmer will be needed to manipulate what you are showing in the question, it can be … Read more
WP Plugin CSS not being applied to page