Agave Plugins Header Logo

Network Posts Extended

The plugin is designed to share posts, pages, and custom post types from across an entire WordPress® multisite network on any given page for any subdomain and the main blog. You may list them in single or double column mode. Add custom css styling to your text, images, whole container and title.

You can specify categories and tags. All posts will be shown in ascending and descending order by date or post ID. You can specify how old (in days) the collected posts may be. Also you can specify how many posts should be displayed from each blog. You can set thumbnails image size and style or disable them. You may also include or exclude posts, pages, categories, and blogs by using the appropriate arguments.

You may install the plugin using one of the three following methods:

Unzip file and using an ftp program upload it to the wp-content/plugins/ directory then activate in plugins page.

Using the search field in the admin plugins area type in network posts extended then install from there.

Go to the upload plugins area in the network admin menu to upload the file.

The default shortcode is [netsposts]. This will list all posts (default) from across the entire network. The following arguments that you may include to fine tune your listing are located below.

Note: Just click on the links for further information detailing that particular argument.

Include/Exclude Arguments

Including Posts
include_post=

This allows you to display specific posts by entering their ID's.

For example:

include_post='23,49,55'

will only show the posts with those specific post ID's.

Note: If there are more than one post with the same post ID which may happen on a multisite network (very rare) all of them will be shown. To narrow it down you may have to include the argument

include_blog=

hide_password_protected_posts='true or false' Default: true. To show passord protected posts in your listing please set the following argument to false.

hide_password_protected_posts='false'

Excluding Posts
exclude_post=

is just like the one above except for the fact that the ID's you include will be excluded from the list. So if you had:

exclude_post='23,55,49'

all posts will be shown except for the posts with those specific ID's.

Including/Excluding Blogs

include_blog=

will only include posts from the specific blogs listed in the argument. The post ID's can be found in the admin section under sites. Hover your mouse over it and a link will appear at the bottom with the blog ID.

exclude_blog=

will show posts from all sites except for the one's listed.

taxonomy=

defaults to categories and you list them by their slug. So for example:

taxonomy='books,hiking,skiing'

will only show posts that are in any of these three categories.

taxonomy_type=

let's you fine tune the list by including categories, tags, or custom taxonomy. This is used in conjunction with the

taxonomy=

argument. So for example if you have

taxonomy='books' taxonomy_type='category'

then it will only show posts that are in the category books. If you change

taxonomy_type='tag'

then it will show books that have a tag called books. It will not show any books in the category called books. If you want to include both then you would simply list

taxonomy_type='category,tag'

It also works now with custom taxonomies. So you have a custom taxonomy called custom-taxonomy then you may use

taxonomy_type='custom-taxonomy'

Note: The plugin now has to the ability to target certain taxonomies by a partial list. For example

taxonomy='singers%'

it will display all posts that belong to a category that starts with singers.

taxonomy='%singers'

will show all taxonomies that end in singers. If you want singers to be included anywhere in the taxonomy name you would use

taxonomy='%singers%'

Filtering by Keywords

filter_by_title_keywords=

will only show the posts if the title contains certain keyword(s). For example

filter_by_title_keywords='red,blue,orange'

This will only show posts that contain all three words in the title.

Including Categories

must_include_categories=

The arguments are true/false (default: false). Here is a little explanation of how this works. You only want to display posts that are in all of the following categories: blue, green, orange. So you set up

taxonomy='blue,green,orange'

When you set

must_include_categories='true'

then only posts that are on all three categories will be displayed. For example Post A and Post B are in all three categories and Post C is only in categories blue and green. Then only Posts A and B will be displayed not Post C. If the argument is not set to true then all posts that are in any of the three categories will be displayed. That is Posts A, B and C will all be displayed. Doesn't matter if they are in all three categories or just one of the three categories.

Show/Hide Arguments

Show For X Amount of Days
days=

allows you to show posts up to a certain number of days old. For example a news site will only want to show the posts for only three days. Then you would include

 days='3'
Show After X Days Old
show_only_after_x_days_old=

Let's say on your news blog you have an archive section where you list the older articles. It will work nicely since you may have

show_only_after_x_days_old='4'

then when all the articles under days= stop showing they will then show up here.

Titles Only

titles_only=

will as you may have guessed only show the titles of the posts. Great for a sidebar or small list. So it would be

titles_only='true'

since the default is false. Only accepts true or false.

Showing Author
show_author=

If is set to true then the author with a link to his bio page will be shown along with all the meta info.

Hide Meta Info
hide_source=

If set to true will hide all the meta info like author, date created, categories etc. The default is false.

Hide Excerpt
hide_excerpt= 

When set to true will hide the excerpt from appearing with the list. Note: It default's to what's in the excerpt box on the page editing area. If nothing there will display an auto excerpt from the content area.

Show Categories
show_categories=

shows a list of all categories above the meta info when set to true. If you would like a folder next to each category also set

show_category_icon='true'
Showing Tags
show_tags=

same as show_categories except it displays all tags related to the post. If you would like a folder next to each category also set

show_tag_icon='true'
Show Custom Taxonomies
show_custom_taxonomies=

this is the same as the two above but will display custom taxonomies you may have created for the particular post. Like above

 show_categories_icon='true'

will display a tag next to each listing.

Show Custom Taxonomies
show_custom_taxonomies=

and

show_custom_taxonomy_icon= 

when set to true act like the ones above but are for custom taxonomies you may have created.

Taxonomy Offsets
taxonomy_offsets= and taxonomy_offset_names=

You may use slugs or taxonomy name. So for example if you wanted to offset three different categories it would look like so:

 [[netsposts taxonomy_offset_names='tax-1,tax-2,tax-3' taxonomy_offsets='5,4,10']]

then tax-1 would be offset by 5, tax-2 4, and tax-3 10. Offsets means it will skip the X most recent posts. If you want to only offset tags or categories use taxonomy_offset_type= so you may use one of these three, tag, category or any.

Note: the best scenario to use the above is if you make two different lists then the first one can contain a large image and full description then the next list will have the more normal smaller size listings.

Thumbnails

thumbnail='true'

will display a thumbnail of the given post or page if it has a featured image.

size=

will display the thumbnail size you choose. For example the default WordPress sizes are thumbnail(150x150), medium(300x300), medium_large(768xauto), large(1024x1024), and full(Original Size). The default is full. So if you would like to show the cropped size of 150x150 you would enter:

size='thumbnail'

for a 300x300 image you would use:

size='medium'

and etc.

Note: If you create custom thumbnail sizes just enter their names here. My network posts extended plugin can create custom thumbnail sizes.

image_class=

If you would like to create a custom class for the image just enter it here.

image_class='aligncenter' 

will center the image. If you need to add more than one just use it in the typical manner. Separate them with a space:

image_class='aligncenter frame'
Setting Default Thumbnail
default_thumbnail='(img-url)'

must be the full url to the image you want to use. Leave the parenthesis and replace img-url with an actual url. Good if posts are missing a featured image.

Excerpts

auto_excerpt='true'

will over ride the default setting of taking the excerpt from the custom excerpt field and create one from the content field. You can trim down the words by using it with

excerpt_length='50'

will trim it down to 50 words and

excerpt_letters_length='100'

will trim it to 100 characters.

manual_excerpt_length= and manual_excerpt_letters_length=

is the same as above but for the text in the manual excerpt field.

Displaying Post Types

post_type=

displays whatever post types you desire. The default is post. So if you had

post_type='post'

nothing would change since that's the default behavior. If you want to list only pages you would use

post_type='page'

or for custom post types

post_type='custom_post_type'

To list posts and pages just use a comma separated list:

post_type='post,page
Showing Full Text
full_text='true'

will display all the content no matter how large the post may be.

Processing Shortcodes in List
use_shortcode_in_excerpt='true'
filter_excerpt='true'

will also run the shortcode that may be in the content area. Other than that it would be ignored. If the above aren't set to true then the plugin will automatically strip all shortcode coding.

Date

date_format=

can be used to display the date anyway you like. All parameters may be found here. The default is

date_format='n/j/Y'

which would display as

January 2 1963

If you like

2 January 1963

better then it would be

date_format='j/n/Y'

Custom HTML

To help make it easier to design the output to your liking I have added the following arguments.

wrap_start=, wrap_end=

can be used as such. Let's say you want to wrap the shortcode output by a div container with an id of listings. You may do so like this:

wrap_start='<div id="listings">' wrap_end='</div>'

Then the whole output container will be wrapped by this outer container.

The following arguments will do the same thing but only wrap their given item:

wrap_title_start wrap_title_end, wrap_image_start wrap_image_end, wrap_text_start wrap_text_end, and wrap_excerpt_container_start wrap_excerpt_container_end.

page_title_style= has been deprecated and no longer works. Just style it via css.

Pagination and Posts per Page Settings

If you like your list to be on several pages after an x amount of posts you may do so and style your pagination as follows.

Length of Lists and Pagination

List Lengths
list=

will display an x amount of posts on the page. For example

list='10'

will display 10 posts per page if set for pagination. If there are more they will be shown on the next page. If

paginate='false'

then only ten will be shown at a time and the 11th one will drop off the list.

paginate='true'

will cause the posts to be paginated after 10 posts which is the default. If you would like the list to have 15 posts per page just set list='15'.

end_size=

will show how many page links will be shown before and after the current page. For example

end_size='3'

will show the first and last three links in numerical form.

mid_size=

will show a numerical list of pages on either side of the current page. So

mid_size='3'

will have three previous links before and the next three page links after the current page.

prev_next='true'

will allow previous and next links to be shown. The default is false. Works with the following two arguments prev and next. This way you can customize the text shown.

prev='Previous Page' next='Next Page'

Defaults are previous and next.

random='true'

will show the posts completely randomly. So if you have the two following arguments included in your shortcode it will list 10 posts randomly regardless of date.

[[netsposts list='10' random='true']]

New Pagination Attributes

load_posts_dynamically='(true/false)'

allows to load posts without refreshing page. Default false. Normally when you go to the next page of the list the whole page refreshes. This function enables the posts to refresh without reloading the whole page. This keeps the user from getting lost from where he was if there is a lot of content also on the page.

posts_preloader_icon='(url to icon)'

Set custom icon url. This icon is displayed while posts are loading if

"load_posts_dynamically"

is set to true.

Note: You must use the argument

shortcode_id='custom-id-name'

for this argument to work. Because it uses the given id to know which one to refresh in case there are multiple instances on one page. Each individual shortcode must have a separate on if they are on the same page.

show_preloader_icon='(true/false)'

to hide default spinning icon. Default true.

Important Information

shortcode_id=

can be given any name. Just make sure if you have more than one instance of this shortcode on the same page each id must be different. That is you can't have multiple ID's with the same name on the same page.

Modified: Made it to support multiple shortcodes with one or more of them that load posts without page refreshing. Set shortcode_id for those shortcodes that loads posts via Ajax. That is if load_posts_dynamically='true' then you must also add the argument shortcode_id='custom-shortcode-id'.

This is how I recommend the ID's should be named on a per page basis. Let's say you have two instances of the shortcode on the same page. I would give the first shortcode an ID of "npe-1" thus the shortcode would be shortcode_id='npe-1' then the second shortcode would have an id as such shortcode_id='npe-2' etc.

Titles

title='true'

if you would like to give the listing its own special title. The posts will be listed underneath. So

title='Bicycles'

will give that specific listing a title of Bicycle. So when working with other arguments you can just list posts related to bicycles.

The following titles have to do with the actual post titles themselves. That is the title of each individual post.

title_color=

adds inline styling for the color of the title. So

title_color='red'

and

title_color='ff0000'

will both give the title a color of red. This function doesn't work when the title link argument below is set to true.

title_length= title_length_characters=

trim the title. For example

title_length='10'

will trim the title to 10 words while

title_length_characters='35'

will trim the title to 35 characters.

include_link_title='true'

will create a permalink to the given post.

exclude_link_title=

Used when the above argument is set to true you may also exclude certain posts from being clickable by putting their ID's here. For example

exclude_link_title='25,49,60'

The posts with the given ID's will not have their titles clickable.

show_title=

has a default of true. But if for some reason you don't want to show the post's title just set this to false.

 show_title='false'

Designs and Lengths

meta_info='false'

will hide all meta information from showing. Some people don't want to show the date or author on certain post or pages so just set this to false.

meta_length=

will shorten the list to an x amount of characters so it doesn't wrap and make the listing look unprofessional. You can test with different lengths so it stays on one line. For example

meta_length='50'

will limit the string to 50 characters.

Miscellaneous Arguments

remove_blog_prefix='true'

will remove the /blog if multisite is installed in a subdomain or sub-folder.

use_shortcode_in_excerpt=

if set to true and your site has the ability to render shortcode in the manual excerpt field then this will allow it to be processed in the listings also.

use_shortcode_in_excerpt='true'

will now render shortcodes in the custom excerpt field.

link_open_new_window='true' will now make all links open in a news window. To include certain links from opening in a new window do the following:

link_open_new_window='48,56,94'

will only make the titles of the posts with the given ID's a link.

Advanced Custom Fields

This plugin now works well with the Advanced Custom Fields plugin you may download from WordPress.

include_acf_fields=

works by putting in a comma separated list of all ACF slugs. So as an example

[[netsposts include_acf_fiels='zip_code,date,email']]

will display the zip codes, dates and emails that were put in those fields of the given post or page.

hide_acf_labels=

Allows you to hide the labels of the given fields. So set

hide_acf_label='true'

to just show the field contents without their labels.

order_post_by_acf_date='acf_field_name asc'

(acf_date_field_name) If you have an events directory and have an ACF field with an event date will list the pages by that order.

order_post_by_acf_date='event_date asc'

where

event_date

is the name of the acf field.

Note: You must add the following to the argument above, asc or desc so the plugin knows how to order the listed posts. Using asc will list the closest upcoming event first.

acf_date_format=

works as the date settings do above except it will now list the nearest upcoming event first.

exclude_all_past_events=

If you have an events custom post type setup with an ACF field named events_date and have

exclude_all_past_events='events_date'

then all events posts with an events_date before today (current date) then they will automatically be removed from the list.

show_past_events=

Works like

exclude_all_past_events

except it will only display events posts from the past. That is events_date is prior to today.

include_acf_fields=

will include all fields listed separated by commas.

[[netsposts include_acf_fields='email,date,content']]

So if you have custom fields with those names they will be displayed also.

show_after_date=

(field_name::date) You have a post with a field name of coupon_date and would not like it to display until after the coupon becomes active like December 15th 2020 then you would list it as shown.

show_after_date='coupon_date::12/15/2020'

show_before_date=

(field_name::date) Same as above but will only show before the given date. So you can set a coupon expiration date.

show_for_today=

(field_name) Shows only for today. So whatever date is selected in the field_name then it has to be today to be displayed. That is only events that are happening today are listed.

 [[netsposts show_for_today='event_date']]

add_link_to_acf='true'

will add a permalink to all acf fields displayed.

More Miscellaneous Arguments

show_rating=

works in conjunction with our Post Reviews plugin to display a star listing of the given rated post, page or custom post type. So if you had a business directory and wanted to include their ratings in the list you may do so.

show_rating='true'

page_has_no_child=

allows you to show all pages that have no children of their own. That is bottom line child pages. Again excellent for directory listings archive pages.

Ordering Posts

Ordering Posts in Ascending Order

The default behavior in all instances is they're listed in ascending order and by date. Here are the ascending order arguments.

order_post_by='date_order', order_post_by='alphabetical_order', order_post_by='page_order'

The last one works for if you have the page attributes setting active. It's active on pages automatically.

Ordering Posts in Descending Order

It's basically the same as above accept you add the word desc to the argument as such.

order_post_by='date_order desc', order_post_by='alphabetical_order desc', order_post_by='page_order desc'

Domain Mapping

domain_mapping=(site_url / home_url)

If you have domain mapping set up on your multisite https://mainsite.com you may choose which format the hyperlinks will display. That is if you have

domain_mapping='site_url'

the domain mapped link or the internal sub domain or sub folder link set up. Example if your site that was mapped is

https://mysite.com

then the link will look like

https://mysite.com/post-name

(or however you set up your permalinks). Otherwise if you chose

domain_mapping='home_url'

it will display as:

https://mysite.mainsite.com/post-name

Network Posts Extended Examples