WordPress plugin: Shortcode

torna alla pagina iniziale

Customize Posts Shortcode by CSS

CSS example 1 CSS example 2

 

 

 

 

 

Customize Posts Shortcode by Template

By default, Shortcodes Ultimate looks for custom templates here: /wp-content/themes/your-theme/su-posts-templates/

So you should create a subfolder of your current them called /su-posts-templates/ and then you can create a new custom template file.
Create a custom Template

Create a new php with whatever filename you want. I’ll use my-custom-loop.php

Now you can add the PHP loop that the shortcode will use to generate the HTML on the front-end.

For example, lets say I wanted to create a custom loop to display a custom field from Advanced Custom Fields called review_rating. It might look like this.

Now save your new template in the /su-posts-templates/ folder of your theme.

Next up, write the custom CSS that will style your template on the front end.
Inserting Custom Templates

When inserting the su_posts shortcode, you can specify a template right in the insertion dialogue.

Make sure to include the path to the folder your loop templates are in (relative to your theme).

You can also add the template directly to the shortcode. Like this: 

 

 

 

Immagini collegate: