New in 4.7: Multiple shortcodes

When we added the shortcode to 4.6 we were not very sure about the way the feature was implemented. Due to the large number of option it was obvious that doing it the “normal” way works and users know it and accept it, but making users cram them on one line hoping that they got the syntax correctly is a bad user experience.
Instead we decided to try a different approch, use the shortcode itself as a pure place holder, and configure the settings via the customizer, with the settings being stored as a custom field in the relevant post DB instead of being part of the shortcode itself.

Wanting to reduce the risk of developing something that people will hate, we implemented in 4.6 only one shortcode per post, but in general it seems like the feature got a good reception, we had a very good experience with it while testing the code and setting our own demo pages, and seems like the only problem where with some obscure page builders (Pippin Williams’s review of them is a must read) and therefor we are enhancing the feature in 4.7 and enabling to have as many shortcodes as you like.

The only change from 4.6, is that if you want to have more then one shortdcode, in order to differentiate between the short codes you need to assign a value which will identify them in the attribute “name”. The value can be anything you like, no special formatting is required. If the name attribute is not explicitly assigned it default to be a “” (empty string).

Here is an example of how it looks in the editor:

Edit Post ‹ test 4.6 — WordPress(1)

And the possible front end output.

4.7 test – test 4.6

This feature will go into the 4.7 version of both the “free” and “pro” plugins due to be released right after WordPress version 4.7 will have its first RC release which is scheduled right now to november the 15th.

You can try the feature by downloading and installing the beta from https://github.com/tiptoppress/category-posts-widget/releases/tag/4.7.beta1, and report bugs or just get an impression of what is planned from our bug repository at https://github.com/tiptoppress/category-posts-widget/issues


Related posts:

With one click to the WordPress “Customizer”

WordPress admin sides have some areas, configuration panels or widgets to configurate.  So you can get all settings in only few clicks. And it wasn’t WordPress if you can configurate all. So we decided to expand this navigation buttons with a additional customizer link. If the user is in post or page edit mode and use our widgets: Term and Category based Posts Widget or Category Posts Widget.

WordPress don’t supports this link because there is no need for this link without using our widgets. But our widgets give you the oportunity to add shortcode in the content area and configurate it in the customizer. Right, we propose the shortcode configuration only in the customizer.

with-one-click-to-the-customizer

We propose to use the customizer to configurate widgets added with shortcode

We know and use widgets which extends WordPress’s admin navigation buttons, menus, etc. For example for navigating between posts or pages with a forward and backward button with the Admin Post Navigation. Widgets like this can be very helpful to change many posts in a row and there is no need to go back to the post edit-site and admins save a lot of time. We decided to write not a own widget and we also decided to make this link not configurable to show or hide. The link we set is fix.

After saving your post or page the “customizer link” is visible and available for use. And you’re with one click in the there:

after-one-click-to-the-customizer

In conclusion here is a interesting blog post why we decided to use the WordPress customizer for the widget options and settings configuration: tiptoppress.com/the-customizer-in-in-our-focus/
Second reason is we had a lot of options to configure and we search a more computed way to do this configuration with shortcode.

Help us us to improve this feature. Most of all we’re looking forward when you write as a comment or private message.

Make a dynamic landing page navigation

With few less custom code changes you make with your post previews a landing page navigation.

  1. Add a few posts in a same category and set for each post nice thumbnail feature images.

add a thumbnail feature image to each post

  1. Use [catposts] to add the the free widget Category Posts Widget to the content with shortcode.

add the widget to the content with shortcode

  1. Go to “View Post” and the added the widget should looks like blank post headlines while no widget options are set.

widget added to the content

  1. Use recent posts and order by filter option from Category Posts Widget

It will be dynamically changed …

… because you can use all the widget setting options for filtering the used posts and set order-by filters for a single category. If you want more and you use a bigger WordPress site, you can use the Term And Category Based Posts Widget wiche adds “custom post types”, “custom taxonomies”, WooCommerce products, multi selections, etc.

Use disable widget CSS option.

widget-option-settings-b

  1. And you get something like this.

configuration in the customizer

  1. Float left to make horizontal alignment.

And for transition you can add CSS3 transition time.

  1. After using the CSS attributs and selectors your content should looks like this.

 

Downlaod link: https://wordpress.org/plugins/category-posts

Category Posts Widget gets “Shortcode”

category-posts-widget-wordpress

Why 4.6.1? because the 4.6 line of versions is meant to be fully compatible with WordPress version 4.6. There  is still some time until it will be released but from our point of view we have completed all the features we intended to have and no new features will be added until WordPress will be in its 4.7 cycle.

So what is new in this release?

What is next? For the 4.6.x line, in addition to fixing bugs we might refine the functionality of the shortcode based on your feedback. For the 4.7.x line we are currently thinking of introducing an offset parameter for the query. (Start your list not with the recent post, in addition remove n-th post from the recent.) Set default thumbnail image and separate filtering of parent categories from their children.

Downlaod link: https://wordpress.org/plugins/category-posts/

Use Shortcode to add “Category Posts Widget” to the content

YES!, the Category Posts Widget is escaping the WordPress sidebar and making its way into any place you can use Shortcode. I think the utility of such a feature is obvious, but to explicitly name at least one obvious use case it will be to give the list of the latest new/PR release. A more respectable place on your home page.

It is also creates a better experience for people that use page builders and tried to integrate the widget into the page builder content.

We are  doing something innovative here. We are assuming that we will have to iterate several times before making it perfect. For that we will need your feedback 😉

How can you use it

The usage of the “widget in a shortcode” has several easy to follow phases:

  1. Just place the shortcode [catposts] at whatever place in the post you want the list of posts to be displayed.
    write-shortcode-to-the-content
  2. Go to preview of the post (it doesn’t have to be preview, any way in which you get the admin bar to show up when you are looking at the post will work)
  3. Enter the customizer by clicking the “Customize” link located at the admin bar.
    customize
  4. Locate the section named “Category Posts Shortcode” and click it (it should be at the bottom of the sections list)
    custshrt
  5. Voila, you should see now all the settings in exactly the same way and functionality as you see them when configuring the widget when it is part of the sidebar.
  6. Once you are happy with the changes, just save and the new settings will be saved

The shortcode itself do not change as a result of the manipulation in the customizer and there is no need to add to it any attributes which will clutter your content.

Limitations

  • You can have only one Shortcode per post. This is just a current code limitation, and we will probably remove this restriction if there is demand for more then one.
  • There is no simple way to duplicate the settings of one Shortcode into a short code in a different post
  • There are all kinds of plugins that let you “include” Shortcodes in all kinds of places. The result of using this shortcode with them are unexpected. We might look into how to integrate with specific plugins if there will be a lot of demand.