Giter Site home page Giter Site logo

display-posts-shortcode's Introduction

Plugin Version Total Downloads Plugin Rating WordPress Compatibility License

Contributors: billerickson
Tags: shortcode, pages, posts, page, query, display, list
Requires at least: 3.0
Tested up to: 6.0
Stable tag: 3.0.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Description

Display Posts is the simplest way to query and display content in WordPress.

Add the [display-posts] shortcode in a post or page. Use the query parameters to filter the results by tag, category, post type, and more.

You can customize the output using the display parameters, or use a template part to match your theme exactly.

Developers can take it even further using the available filters.

See these tutorials for many examples of customization options.

Documentation

Extensions

display-posts-shortcode's People

Contributors

abouolia avatar billerickson avatar cleberps avatar danielbachhuber avatar dknauss avatar garyjones avatar gutschik avatar helgatheviking avatar jhult avatar jjeaton avatar ryszard-trojnacki avatar shazahm1 avatar xedecimal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

display-posts-shortcode's Issues

Different CSS Class for Post Date

Is there a way to specify a different css class for the date? I will use the [display-posts] shortcode twice on a page for two different categories, but I want the post date to have different styles. Is that possible?

Thank You

Pagination support

Hello
I was wondering how I could add paginated pages using your shortcode and Genesis?
Thanks

Display Comments?

Love the plugin but is there anyway to have the comments and the comments form be displayed with the content for a post? I would appreciate any help. Thanks

Space between post

Hello, is it possible to add a space between diplayed post? if you go here www.homeirag.com/main, you'll see the post are looking kinda squished. Love the plug in, would love some help too.

thank you,
Francisco

Post meta

Is there a method to display post meta with the shortcode?

Display ALL posts (in a category)

How does one use the shortcode to display all available posts, for example in a category? Without specifying a number for the posts to show argument.

display categories

how would I display categories and tags for the posts. Can't find it anywhere?

Thumbnails

Hello! I love this plugin. Thanks for contributing it. I have 2 questions, though.

  1. Is there a way to make the excerpt display on a separate line from the title?
  2. I have set the featured image on my posts and have set the shortcode to image_size="thumbnail" but my images aren't coming through. Is there a setting I am missing?

Thanks!
Amy

Changing Layout

Hello,

First, a big thanks for this plugin.
Question: is there a way to display the article in the below format:

Title (Left)

exceprt text goes here [ Image (Right) ]
text text goes here, this is a dummy text

Thanks

Display full content

Hello,

I would like to know where should I put the code related to display full content. I shall be doing something wrong, cause I've tried for several times, but without success.

I would appreciate a help. Thanks.

I would not view subcategories

Hi All,

I would not view subcategories. If I use [display-posts category="name"] and "name" has 2 subcategories, I see 3 item: "name"+ 2 subcategories.

How can I view only category "name"?
Tks,
Robert

using the "category" causes issues

When attempting the use following shortcode:

[display-posts category="xxxxx" posts_per_page="3" image_size="thumbnail" include_excerpt="true" ]

The image_size, & include_excerpt elements were ignored. That is no image or excerpt were displayed on the front end.

Is this a known problem and/or is there a fix for this ?

query error

I got this "SELECT ....... Where 1 = 1 AND 0 = 1 ....",0 = 1 must not included in query string, for the mean time this is my solution.

function dc_post_where($query){
global $wpdb,$wp_query;
if(strpos($query,'posts') != false){
$query = str_replace('AND 0 = 1','',$query);
}
return $query;
}
add_filter('posts_request','dc_post_where');

Add support for custom post types

Currently, it seems that the plugin only works with the default Posts type. It would be wonderful if the post also worked with custom types as well.

Read More Button??

Hello,

I wonder if I can use same button that is used by my theme. It is [...] appearing right now, I want to have "Read More" button instead of dots.

Thank you for your help.

extract() is a dangerous function

... because it potentially allows unexpected variables to enter your code execution.

Instead, each variable should be explicitly identified.

Remove spacing between post title and date

Hi there,

Can you please help? I'm using the shortcode as follows: [display-posts include_date="true" posts_per_page="5" wrapper="div"]

This displays the title, then a blank space, then the date... How would I remove the blank space so that the date displays right next to the title?

Wonderful plugin, by the way!!

Pass the shortcode attributes as an argument in the "display_posts_shortcode_wrapper_open" filter

This is an enhancement proposal. I want to render all the shortcode attributes as class names for the outer HTML wrapping of the plugin's output. If the display_posts_shortcode_wrapper_open filter had a second argument that passed the instance's attributes into this function, then this could be accomplished. Without such contextual awareness, this filter isn't so useful besides changing out the tag name.

Pagination

Hi, i use your display-posts-shortcode plugin for wordpress and i have a question about this.

Have any form to display a pagination between the result of query??

Thanks for help and sorry for my english

Include information about the current 'n' of the post in display_posts_shortcode_output()

For this filter, a developer may want to change markup based on the nth child of the current post item relative to the entire set of posts that the shortcode is outputting in a loop. For example, a developer may want to automatically add a "See all posts »" link after the last item in a list. Can you add a filter parameter that would provide this counter value?

Post Status should be removed

Someone contacted me directly, pointing out that the post status field allowed people to view private posts:

All site users with create_post permission can do the following and are
able to see the contents of private posts of all users, e.g. administrators:

[display-posts posts_per_page="-1" post_status="private" include_content="true"]

In fact the plugin is a db query tool without permission management.
This hurts privacy strongly. Probably only admins ("manage_options"
permission) should be able at all to save the "display posts" shortcode
to the db. Why anybody else should be allowed to create post lists?

I responded by limiting private posts to users with permission to view it ( @ee038a7 ). His recommendation is to remove post_status it altogether.

The "post_status" db
field is really a very dangeerous attribute to offer, because it
bypasses at least in some cases the content permission strategy of WP.

@danielbachhuber, what are your thoughts?

Pass $original_atts variable to wrapper filter functions

Hi Bill, I'm currently working on a plugin that I would like to be able to play along with yours, but right now the fact that the shortcode atts aren't available in the output wrapper filter functions is making my life extremely difficult :) Would it be possible to include the var in those two filters? Cheers, Peter

Impossible to render content tags and shortcodes in posts-shortcode

Hello, it seems like no possible to rendrer via display-posts, article in which there already are some other shorcodes, like accordion or button etc. Is there a way to do so ?
Thx

Edit : actually, it seems like nothing is properly rendered : titles for example are rendered like regular text

Using Advanced Taxonomy Queries in Wordpress.com

Hi,
Can you help me with how to write the shortcode for advanced taxonomy queries in Wordpress.com.

I am trying to show all posts that has Category="ABC" but NOT Category="XYZ"

I have tried this but it does not seem to work.

[display-posts taxonomy="category" tax_term="ABC" taxonomy_2="category" tax_2_term="XYZ" tax_2_operator="NOT IN"]

If that doesn't work, can you suggest any other way of doing this.

Display post shortcode not work with > 2k posts

Hi,anyone help me pls,im using display posts shortcode and another list post plugin to how my post list,but they doesn work with my site > 2k posts,when i change [display-posts posts_per_page="1000"] then it works fine..so anyone help me fix this problem ? tks and sr for my bad english

Plugin on Multisite

I'm using a Multisite setup for Wordpress. I added the plugin to the Admin Panel and activated over the network. I'm not getting any option on activating the plugin on individual pages and the shortcodes are not working with the plugin only activated in the admin dashboard.

Two or more authors?

[display-posts author="bill"] Is it possible to have comma separated values in "author" If yes, what is the shortcode? author="one,two,three" does not work.

Show an icon next to certain post titles

Hi,

I'm using your awesome plugin!

Is there a way to show an icon next to each post title when displaying a list of posts using the plugin? I would like to highlight some posts in a special category. Is that possible?

Thanks

Add support for rendering post with the theme files

I didn't have permission to push to the repo so I just posted the change as a Gist.

I added the capability to render the post with the theme files, e.g. content.php, content-event.php, etc. Most significant changes are at lines 261-274

Source
https://gist.github.com/unhinged/a21fd9426315a0bf220b

Diff of my version to master:
(though Github is highlighted way too much because of whitespace differences)
https://gist.github.com/unhinged/a21fd9426315a0bf220b/revisions

Usage:

[display-posts display_format="theme"]

Any value except for theme (including when the attribute is absent) results in the current rendering behavior.

Explanation of change

In the loop to render the post, when display_format=="theme", I redirect standard output from the page into a buffer. Then I append $inner with the contents of the buffer and close the buffer. See ob_start for more details.

The actual rendering of the markup is delegated to get_template_part. Currently, I hardcoded content as the only slug option because the other values I tried (i.e. page, loop) caused significant performance and content issues that seemed unsalvageable.

Spurious characters inserted at the end of short posts

Spurious characters: "by" appear at the end of post excerpts when the text is too short. When the original post is longer than 1300 characters/200 words, the software inserts a [...] to show that there is more and doesn't add any spurious characters.

screen shot 2014-02-16 at 15 34 06

Here is the code I used: [display-posts category="Art" include_excerpt="true" image_size="thumbnail" wrapper="ul” order="ASC" orderby="date_start"]

Include author option

Hi, I found this post from early 2013 about including an author (include_author) and tried to use it but noticed it's still not available?

#15

Are there any updates on when this functionality will be available?

Thank you!

<!--more--> tag does not work

Hey,
Just wanted to know if it is possible to get the tag to function within this plugin? Right now the entire posts content is displayed and the tag is ignored. Is there some way to activate it or make the plugin recognize it?

Thanks

No image when category is specified

No image is displayed with the post when I specify I category. Here's my shortcode:
[display-posts include_excerpt="true" image_size="thumbnail" wrapper="div" category="website-development"]

If I remove category="website-development", then images are displayed.

redundant the_title filtering

Hey Bill,

Love this plugin.

Getting right to it on line 228: ... apply_filters( 'the_title', get_the_title() )

There's no reason to manually apply the title filters as get_the_title() already applies them. http://queryposts.com/function/get_the_title/

This created a problem with my output in a specific case which was resolved by reducing that code to just get_the_title().

Cheers!

Create multiple custom format output

Hello, first of all thanks for the great plugin. I would like to know if there were a way to create different custom format output and the select the one I want in the shortcode tag.
For example I want a list on a page, full contents on another. Would it be possible to have an argument in the shortcode to set my custom format ?
Thanks

Image Missing for Category Display

Hello - I am having an issue when trying to display a post category on a page with an image.

The category is showing up but the image is not. When I remove the category code the image displays (along with all of the posts).

Is there a way to fix this?

[display-posts category="Wine Travel Articles" image_size="thumbnail" wrapper="div"]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.