Members only Passthrough
Members only Passthrough
Members only Passthrough
the_post_thumbnail echoes its value, which doesn’t work in variable assignment. Use get_the_post_thumbnail instead. Most WordPress API functions follow this pattern, there are typically two versions – one which will echo the result and another with get_ prepended which will return the result.
I am not sure but do you want to get that attribute value to work on them ? This is a way to do so // Add Shortcode function formatage( $atts , $content = null ) { // Attributes extract( shortcode_atts( array( ‘ptid’ => ”, ‘ptle’ => ”, ‘page’ => ”, ), $atts ) ); … Read more
I think you should be able to register your stylesheet with wp_register_style(), then load the stylesheet via wp_enqueue_style() from within the shortcode’s function, so it only loads when the shortcode is executed. For a rundown on how this will work here’s a good article. It refers to scripts, but I believe the same is true … Read more
This is because shortcodes filter the content passed to the and replace based on the shortcode tag. In your case I recommend using get_the_time instead since it provides the same functionality but returns the value instead of echoing it. For more info on date formatting and args for this tag check out get_the_time
I had the same problem. Here is the solution: jQuery(document).ajaxSuccess(function() { jQuery(‘.tippy’).tippy({ position: “link”, offsetx: 0, offsety: 10, closetext: “X”, hidedelay: 700, showdelay: 100, calcpos: “parent”, showspeed: 200, hidespeed: 200, target: “_blank”, showtitle: true, hoverpopup: true, draggable: true, dragheader: true, multitip: false, autoshow: false, showheader: true, showclose: true, htmlentities: false }); }); Put this anywhere … Read more
There are two more possible ways Use the browser’s history API to manipulate the URL displayed at the address bar/ history. Use AJAX Redirection is the best solution for 100% browser support and it is probably the easiest to implement. You don’t need to use any hook with that just do the processing without generating … Read more
You’re using it twice differently, but you’re not creating a unique transient name, so the second time the shortcode runs it just uses whatever was saved in the transient the first time the shortcode ran. Come up with some way to uniquely identify the transient, like: set_transient( ‘shortcode_post_’ . sanitize_key( $a[‘name’] ), $shortcode_post, 60*60*4 ); … Read more
$html . = echo ” . $my_theme[‘social-twitter’]; will throw the error. because syntax is wrong. you will try this: $html.= ‘ ‘ . $my_theme[‘social-twitter’];
First of all, never use anonymous functions, never. Anonymous functions can’t be removed later by plugins or themes Secondly, have a look at the Shortcode API on how to properly create a shortcode. Thirdly, this is not a wordpress specific problem, but pure php. You are using html and php together without the proper syntax … Read more