Tag Info

New answers tagged

0

Try this way, it's not the proper way to figure it out but it will solve your problem. function citrusafterpayment_function() { static $calls = 0; if($calls == 0){ $calls++; mail('test.gupta@test.com','check-in','asd'); global $wpdb; if(isset($_REQUEST['TxStatus']) && $_REQUEST['TxStatus'] != '') { ...


0

It solved well when I added: wp_reset_query(); After closing the while


2

You can not execute functions inside the do_shortcode() call like you are trying to. If you are just trying to wrap your post meta content with the shortcode, then you can do it like shown below. $your_post_meta_variable_content = get_post_meta( $postid, principal_1, true ); echo do_shortcode( '[learn_more caption="ancila"]' . ...


1

You can check this out - wpgallery plugin, this is how they do it for the [gallery] shortcode, basically parsing the shortcodes on the client-side, and replacing them back and forth as you click "Visual" or "Text". Unless you are building a plugin, I would advise you to refrain from using shortcodes - use plain HTML, you'll have an easier time working with ...


0

OK, thank you to ialocin, the $gbquery->max_num_pages solve it! So there is the clean code : function livredor_function($atts,$content=''){ extract(shortcode_atts(array( id => '' ), $atts)); ob_start(); function create_guestbook() { $current_page = (get_query_var('paged')) ? get_query_var('paged') : 0; ...


0

Skimming through the core file, there are some quick & dirty ways available (untested): ! is_admin() && add_filter( 'wp_nav_menu_items', 'do_shortcode' ); ! is_admin() && add_filter( 'the_title', 'do_shortcode' ); ! is_admin() && add_filter( 'walker_nav_menu_start_el', 'do_shortcode' ); But I would rather ...


0

The issue I worked out was that I'd previously built another form on my staging site using CCF, I went through phpmyadmin posts and deleted everything ccf-based then rebuilt my form and since there were no previous forms this form was assigned the id 122 and my template now works :) It would still be good to know if there's a way to search for wildcards ...


0

Nice one, you were practically there - the key is to assign the $ecpt_imdb variable with the data returned from get_post_meta: <?php if ( $ecpt_imdb = get_post_meta( get_the_ID(), 'ecpt_imdb', true ) ) : ?> <h3>About the Movie</h3> <?php echo do_shortcode( '[imdb]http://www.imdb.com/title/' . $ecpt_imdb . '/[/imdb]' ) ?> ...


0

First: I feel the need to ask where exactly are you putting this php code? Hopefully not in the content area of the page through the WordPress Dashboard as php does not work there. (This is the "is it plugged in?" question that needs to be asked first.) You must put all php code inside a .php file in your theme somewhere. Don't feel insulted or stupid, it ...


0

this should work <?php echo do_shortcode('[shortcode_products_by_brand title="Promozioni" per_page="12" columns="4" orderby="title" order="desc" brand="'. $entity->getSlug() .'" operator="IN"]') ?>


0

You need to generate the shortcode within the loop, and then execute it afterwards: if ( have_rows( 'homepage_slider' ) ) { $shortcode = '[ux_slider timer="4500" arrows="true" bullets="true" auto_slide="true" nav_color="light"]'; while ( have_rows('homepage_slider') ) { the_row(); $shortcode .= '[ux_banner bg=" ' . get_sub_field( ...


0

I realize this is an old question, but I recently needed to do just this. My solution was to hook into wp_head and run any shortcodes in the post content. This works because the shortcodes I'm dealing with call wp_enqueue_script and wp_enqueue_style when they are processed. The code looks something like this: function example_shortcodes() { global ...


0

Alright I want to post this here because of the title of your question. There is a way to change shortcode attributes, but it will also rely on what the developer of the plugin has done. When a plugin is developed with a shortcode there is an option to use the shortcode_atts() function. This happens most of the time I would say but what some people don't ...


3

They're probably referring to the functions file in your theme, functions.php. This file is loaded by WordPress during setup, and gives you an opportunity to do things or register hooks and filters. Note that this file is optional, and not every theme has a functions.php, if that's the case just create one yourself Keep in mind the only thing that's special ...


0

I am not sure what are you trying to get here: Sabai::_h($entity->getSlug()); but Since you are echoing a statement, you need to store the value in a variable first and then call it within the shortcode string. <?php $brand_variable = Sabai::_h($entity->getSlug()); echo do_shortcode('[shortcode_products_by_brand title="Sample brand products" ...


0

The WordPress doesn't operate with concept of partial content. The content of the post is seen as single block of text/markup, possibly with embedded external elements. Even in latter case that is considered one way flow — content output will process embeds, but embeds aren't meant to be extracted from content. In your case I would guess the data ...


1

Yes it is possible. There are two ways that I can think of at this moment. First follow what the codex says Shortcodes. Basically you just wrap your html in ob_start(); this will return the html as a string so you can echo it. function my_shortcode() { ob_start(); ?> <HTML> <here> ... <?php return ob_get_clean(); } The ...


0

Mobile theme plugins typically sniff the user agent and just switch out your main theme for a bundled "mobile friendly" generic one. In the process, any shortcodes registered in your theme are no longer recognised, and they just display as plain text. Check out the plugin documentation, or contact the developer, and see if they can offer any insight. I ...


0

I was wandering (sic) how I can tell if the quality of the theme is good or bad? From what you've described, it doesn't sound great. The trouble with premium themes is the author can code it however (badly) they like - since it's not in the WordPress themes directory, it doesn't have to play by any of the rules. Any advice on how to proceed? ...


0

got it working now... I added a counter $i = 0; $childnum = count($children); just after the if statement of the children. & added this code if ($i == $childnum - 1) { $output .= '<div class="viewmore">'. $viewmore .'</div>'; } $i++; after the the code: $output .= '<div ...


0

You cannot return an array from inside a shortcode, this will lead to the following error Array to string convertion ..... The output from a shortcode needs to be a string, so you need to convert your array to a string. You also cannot echo anything inside a shortcode, neither can you use functions or template tags inside a shortcode which echos its ...


3

You need a couple of things. A shortcode handler, and a custom query: function wpse_186346_excerpt_length() { return 50; } function wpse_186346_excerpt( $atts ) { $atts = wp_parse_args( $atts, array( 'posts_per_page' => 2, // Any other default arguments ) ); // We don't need paging, always save a ...


3

Here's just an addition to the answer by @PieterGoosen. There are few methods how one could modify the post type of WP_Query, that's inside a shortcode. Let's assume it's [recent_posts]. Method A) If the shortcode uses the third parameter of the shortcode_atts() (as @PieterGoosen mentioned) for example wpse, then: /** * Method A: Using the ...


4

Without seeing your code it is difficult to give you an exact answer. There is the shortcode_atts_{$shortcode} filter that was introduced in Wordpress 3.6. All attributes is run through this filter. It has to be noted that the $shortcode parameter needs to be set in shortcode_atts. I haven't seen shortcodes yet that has this parameter set though. Your ...


1

What if you concatenate the string, like $author_ig = '[instagram-feed id="' . get_the_author_meta('instagram') . '" imageres="full" showheader="true" showbutton="true" buttoncolor="#fff" buttontextcolor="#000" showfollow="false"]'; echo do_shortcode($author_ig); I used get_the_author_meta instead of the_author_meta, because the former returns the ...


0

Use Output buffering for the best result of shortcode, especially when you are outputting some HTML in it: function f_girl_shortcode( $atts , $content = null ) { ob_start(); ?> <div class="talk girl"><?php echo do_shortcode($content); ?></div> <?php return ob_get_clean(); } add_shortcode( 'talk-girl', ...


0

At the end of your function return the output as described in the documentation. return ob_get_clean(); Add the [myshorcode] shortcode to a text widget. By default, widgets are not rendered in text widgets so make sure you add this snippet to your plugin: add_filter('widget_text', 'do_shortcode');


0

Instead of calling the iframe , You can register a widget that will contain all the HTML code.Another way can be outputting the whole HTML code instead of iframe."id" can be controlled in the same manner. Combine all CSS files and JS files and then enqueue them in the same manner.Keep HTML code only between the body part.I am not sure but may be this helps.


2

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>'; ...



Top 50 recent answers are included