Complex Slider Shortcode Help
Complex Slider Shortcode Help
Complex Slider Shortcode Help
If anybody is interested: I managed it to add a data attribute to the article thumbnail with following filter: function post_thumbnail_add_data_attribute( $input, $post_image_id ) { $caption = wptexturize(get_post(get_post_thumbnail_id())->post_excerpt); $substitute = is_home() ? “<img” : “<img data-description=\”” . $caption . “\””; return str_replace(“<img”, $substitute, $input); } add_filter(‘post_thumbnail_html’, ‘post_thumbnail_add_data_attribute’, 10, 3 ); For the gallery I followed … Read more
I realise that you say that you can’t enable paging of users, but if it’s a case of you don’t know how, you can pass ‘number’ and ‘offset’ in the args array. In your example to get page 2 of your users, set ‘number’ as ‘5’ and ‘offset’ as ‘5’. If using those variables is … Read more
Adding shortcode field to edit gallery / Gallery Settings
Add button to kitchen sink toggle
This is not bulletproof, but should work perfectly fine in most cases: class WPSE_105676_Gallery_First { private static $_gallery = ”, $_handler; public static function gallery( $attr ) { self::$_gallery .= is_callable( self::$_handler ) ? call_user_func( self::$_handler, $attr ) : ”; return ”; } public static function content( $text ) { $text .= self::$_gallery; self::$_gallery = … Read more
Ok, for some reason it’s now working. Instead of hooking into ‘init’ I’ve used ‘the_post’ and the form shortcode does it’s job. I no longer have an issue with publishing a new post or the data not saving. Also, no “Cannot modify header information – headers already sent” error. The function function el_process_form(){ if( $_SERVER[‘REQUEST_METHOD’] … Read more
To fetch users with certain meta field, you can use WP_User_Query class. Check codex manual for it. So you can create a custom shortcode like this: add_shortcode( ‘listusers’, ‘wpse8170_listusers’ ); function wpse8170_listusers( $atts, $content=”” ) { $atts = shortcode_atts( array( ‘company’ => false ), $atts ); if ( empty( $atts[‘company’] ) ) return $content; $query … Read more
function get_page_func( $atts ){ extract(shortcode_atts( array( ‘title’ => ” ), $atts ) ); $page = get_page_by_title($title); $args = array( ‘include’ => $page->ID, ); $pages = get_pages($args); $html = $pages[0]->post_content; $html = do_shortcode($html); return $html; } add_shortcode( ‘get_page’, ‘get_page_func’ ); Use above code. Wherever you require shortcode to be executed just use the following line echo … Read more
You can try to re-register the default WordPress shortcode: /** * Re-Register the default shortcode * WPSE: 120057 */ function wpse_120057() { add_shortcode( ‘video’, ‘wp_video_shortcode’ ); } add_action( ‘plugins_loaded’, ‘wpse_120057’ ); Here is the file in the Shortcodes Ultimate plugin that contains the shortcode registration.