My first WordPress shortcode just returning []

As discussed in the comments, ‘Card Table’ is an invalid shortcode tag name. Shortcode tag names must not contain any of the following: The characters <, >, &, /, [, ], = Whitespace characters (spaces, linefeeds, tabs, etc.) Any other non-printing/Unicode “control code” characters The old Codex page also recommends avoiding hyphens/dashes and uppercase letters, …

Read more

How to remove https:// from shortcode generated url

That would be: return parse_url( get_site_url(), PHP_URL_HOST ) ); Explanation: get_site_url is the WP function that returns the full url (it is the function that site_url relies on). parse_url is a PHP function that splits the url into several components and returns one or more of them. In this case it returns the hostname, which …

Read more

How to create shortcode of this PHP code

This should do it.. function future_posts_function($atts){ extract(shortcode_atts(array( ‘poststatus’ => ‘future’, ‘order’ => ‘DESC’, ‘showposts’ => 10, ), $atts)); $return_string = ‘<ul>’; query_posts(array(‘post_status’ => $poststatus, ‘order’ => $order, ‘showposts’ => $showposts)); if (have_posts()) : while (have_posts()) : the_post(); $return_string .= ‘<li>’.get_the_title().'</li>’; endwhile; endif; $return_string .= ‘</ul>’; wp_reset_query(); return $return_string; } add_shortcode(‘future_posts’, ‘future_posts_function’);

Seo Problems in My meta Discription [closed]

What you are seeing there is the shortcodes for your theme. You are likely using a theme builder which is why there are so many shortcodes. In the back-end, they will show as they are not being executed until they hit the front-end. You can see how shortcodes work with explanations here. In reality, they …

Read more

Create a shortcode to display the “the_content ()” in my post [closed]

Here is an example of a shortcode that renders post content based on the id and type attribute. [post type=”content” id=”2″] [post type=”title” id=”2″] If you want to render from a template you would use: echo do_shortcode ( ‘[post type=”content” id=”294″]’ ); echo do_shortcode ( ‘[post type=”title” id=”294″]’ ); And here is the actual shortcode …

Read more