Agave Plugins Header Logo

NPE Include and Exclude Arguments

On this page I'm just going to give you several ideas on how the include exclude features work. I will keep the same basic design but hide different parts of the listing with the use of shortcode arguments.

I'm including a thumbnail just so you can see it with everything showing. We'll use the same basic setup but I will specifically include the posts. I won't show any CSS here if you would like to see what it is use the inspector tool in your browser.

[netsposts shortcode_id='include-exclude' thumbnail='true' include_post='9']

Password Reset
Published 3/23/2020 in Agave Plugins LLC
Rain Forest Water Falls
Published 4/3/2020 in Rain Forest Scenic Pictures
Rain Forest Waterfalls
The Amazon is one giant rain forest, so it is not surprising that there are dramatic waterfalls throughout the region, particularly during the wet season. The contrast of cascading water, rocky outcrops and tropical greenery make Amazonian waterfalls a visual treat.read more ❯

As you see above only one post is showing because I told the plugin to only include the post which has an ID of 9. If there so happens to be more than one post with an ID of 9 (very rare usually only happens when websites are copied over).

[netsposts shortcode_id='include-exclude' thumbnail='true' exclude_post='9' list='4' paginate='false']

I added list='4' just to keep the list small. Plus paginate='false' since I want to keep the example small. If the posts get more than 4 in total it will just show the 4 latest posts.

Hello world!
Published 10/19/2020 in Agave Plugins Download Files
Welcome to Agave Plugins for WordPress and more.... This is your first post. Edit or delete it, then start writing!read more ❯
Pacific
Published 4/4/2020 in Ocean Views
Pacific Ocean Sunset
The Pacific Ocean is the largest and deepest of Earth's oceanic divisions. It extends from the Arctic Ocean in the north to the Southern Ocean (or, depending on definition, to Antarctica) in the south and is bounded by the continents of Asia and Australia in the west and the Americas in the east.read more ❯
Rocky Mountains
Published 4/4/2020 in Mountain Ranges of the World
The Rocky Mountains
The Rocky Mountains, also known as the Rockies, are a major mountain range located in western North America. The Rocky Mountains stretch 3,000 km (1,900 mi) in straight-line distance from the northernmost part of British Columbia, in western Canada, to New Mexico in the Southwestern United States. The northern terminus is near the Liard River, while the southernmost point is near Albuquerque, adjacent the Sandia–Manzano Mountains. Located within the North American Cordillera, the Rockies are distinct from the Pacific Coast Ranges, Cascade Range, and the Sierra Nevada, which all lie farther to the west.read more ❯
Test Post 1
Published 9/1/2021 in Agave Plugins Private Support

Now we'll start including certain blogs in the listing the listing. Let's say you only want to show things from the blog about the rain forest. How do I know which ID to include?

You do so by going to My Sites >> Sites >> All Sites and hover your mouse over any of the sites you want to include. You'll see the blog's ID number in the link at the bottom left of the page. The following image give you an idea.

How to Find Blog ID
How to Find Blog ID

[netsposts shortcode_id='include-exclude' thumbnail='true' include_blog='2' list='4' paginate='false']

Rain Forest Water Falls
Published 4/3/2020 in Rain Forest Scenic Pictures
Rain Forest Waterfalls
The Amazon is one giant rain forest, so it is not surprising that there are dramatic waterfalls throughout the region, particularly during the wet season. The contrast of cascading water, rocky outcrops and tropical greenery make Amazonian waterfalls a visual treat.read more ❯

You only see one listing because that site as of now only has one post on it. When more posts are created they will be added on this list up to a maximum of four. Because of the argument list='4'.

The above examples also works even if you have chosen to only list pages. The only difference is you would add the argument post_type='page' and if you have a custom post type called favorite movies you would just add post_type='favorite-movies'. It's the custom post types slug is what you enter. If you want to list both posts and pages then you would have the following: post_type='post,page'or any other combination you can think of.

The other arguments can be figured out on their own as in if you only want to include posts in a certain category you would add the following two shortcodes.

  • taxonomy_type='category'
  • taxonomy='books' if books is the name of the category.

If you just have taxonomy='books' and their are both tags and categories with that slug it will display both. Even if it's a custom taxonomy it will display those also. There is no option to exclude individual taxonomies. Just include.

Okay now we'll get on to talking about what content you would like to display. That is only show or exclude any given part. We'll start from the top down.

To continue with the above shortcode we will add an argument called show_title='false'. This will hide the title. Why somebody would want to do that is beyond me but I had a user request it.

[netsposts shortcode_id='include-exclude' thumbnail='true' list='4' paginate='false' show_title='false']

Published 10/19/2020 in Agave Plugins Download Files
Welcome to Agave Plugins for WordPress and more.... This is your first post. Edit or delete it, then start writing!read more ❯
Published 4/4/2020 in Ocean Views
Pacific Ocean Sunset
The Pacific Ocean is the largest and deepest of Earth's oceanic divisions. It extends from the Arctic Ocean in the north to the Southern Ocean (or, depending on definition, to Antarctica) in the south and is bounded by the continents of Asia and Australia in the west and the Americas in the east.read more ❯
Published 4/4/2020 in Mountain Ranges of the World
The Rocky Mountains
The Rocky Mountains, also known as the Rockies, are a major mountain range located in western North America. The Rocky Mountains stretch 3,000 km (1,900 mi) in straight-line distance from the northernmost part of British Columbia, in western Canada, to New Mexico in the Southwestern United States. The northern terminus is near the Liard River, while the southernmost point is near Albuquerque, adjacent the Sandia–Manzano Mountains. Located within the North American Cordillera, the Rockies are distinct from the Pacific Coast Ranges, Cascade Range, and the Sierra Nevada, which all lie farther to the west.read more ❯
Published 9/1/2021 in Agave Plugins Private Support

Looks kind of weird doesn't it? Now we'll hide the meta info. That is the author, date and which blog it's posted from.

[netsposts shortcode_id='include-exclude' thumbnail='true' list='4' paginate='false' hide_source='true']

Hello world!
Welcome to Agave Plugins for WordPress and more.... This is your first post. Edit or delete it, then start writing!read more ❯
PacificPacific Ocean Sunset
The Pacific Ocean is the largest and deepest of Earth's oceanic divisions. It extends from the Arctic Ocean in the north to the Southern Ocean (or, depending on definition, to Antarctica) in the south and is bounded by the continents of Asia and Australia in the west and the Americas in the east.read more ❯
Rocky MountainsThe Rocky Mountains
The Rocky Mountains, also known as the Rockies, are a major mountain range located in western North America. The Rocky Mountains stretch 3,000 km (1,900 mi) in straight-line distance from the northernmost part of British Columbia, in western Canada, to New Mexico in the Southwestern United States. The northern terminus is near the Liard River, while the southernmost point is near Albuquerque, adjacent the Sandia–Manzano Mountains. Located within the North American Cordillera, the Rockies are distinct from the Pacific Coast Ranges, Cascade Range, and the Sierra Nevada, which all lie farther to the west.read more ❯
Test Post 1

As you can see by complete removing the posts source information it throws the html out of wack. One easy way to fix that is to add a wrapper around the title and give it the inline CSS to clear: both;.

[netsposts shortcode_id='include-exclude' thumbnail='true' list='4' paginate='false' hide_source='true' wrap_title_start='<div style="clear: both;">' wrap_title_end='</div>']

Hello world!

Welcome to Agave Plugins for WordPress and more.... This is your first post. Edit or delete it, then start writing!read more ❯

Pacific

Pacific Ocean Sunset

The Pacific Ocean is the largest and deepest of Earth's oceanic divisions. It extends from the Arctic Ocean in the north to the Southern Ocean (or, depending on definition, to Antarctica) in the south and is bounded by the continents of Asia and Australia in the west and the Americas in the east.read more ❯

Rocky Mountains

The Rocky Mountains

The Rocky Mountains, also known as the Rockies, are a major mountain range located in western North America. The Rocky Mountains stretch 3,000 km (1,900 mi) in straight-line distance from the northernmost part of British Columbia, in western Canada, to New Mexico in the Southwestern United States. The northern terminus is near the Liard River, while the southernmost point is near Albuquerque, adjacent the Sandia–Manzano Mountains. Located within the North American Cordillera, the Rockies are distinct from the Pacific Coast Ranges, Cascade Range, and the Sierra Nevada, which all lie farther to the west.read more ❯

Test Post 1

Now we'll just hide the excerpt by adding hide_excerpt='true'.

[netsposts shortcode_id='include-exclude' thumbnail='true' list='4' paginate='false' hide_excerpt='true']

Hello world!
Published 10/19/2020 in Agave Plugins Download Files
Pacific
Published 4/4/2020 in Ocean Views
Pacific Ocean Sunset
Rocky Mountains
Published 4/4/2020 in Mountain Ranges of the World
The Rocky Mountains
Test Post 1
Published 9/1/2021 in Agave Plugins Private Support

That pretty much gives you an understanding of the whole picture of including and excluding. There are more out there just check the list of arguments page.

If you would like to also show what categories the post belong two you may include them with a permalink to the given category.

[netsposts shortcode_id='include-exclude' thumbnail='true' list='4' show_categories='true']

Hello world!
Published 10/19/2020 in Agave Plugins Download Files
Welcome to Agave Plugins for WordPress and more.... This is your first post. Edit or delete it, then start writing!read more ❯
Pacific
Published 4/4/2020 in Ocean Views
Pacific Ocean Sunset
The Pacific Ocean is the largest and deepest of Earth's oceanic divisions. It extends from the Arctic Ocean in the north to the Southern Ocean (or, depending on definition, to Antarctica) in the south and is bounded by the continents of Asia and Australia in the west and the Americas in the east.read more ❯
Rocky Mountains
Published 4/4/2020 in Mountain Ranges of the World
The Rocky Mountains
The Rocky Mountains, also known as the Rockies, are a major mountain range located in western North America. The Rocky Mountains stretch 3,000 km (1,900 mi) in straight-line distance from the northernmost part of British Columbia, in western Canada, to New Mexico in the Southwestern United States. The northern terminus is near the Liard River, while the southernmost point is near Albuquerque, adjacent the Sandia–Manzano Mountains. Located within the North American Cordillera, the Rockies are distinct from the Pacific Coast Ranges, Cascade Range, and the Sierra Nevada, which all lie farther to the west.read more ❯
Test Post 1
Published 9/1/2021 in Agave Plugins Private Support

As you can see above the image and below the meta/source information there will be a horizontal list of all categories the particular post belongs to. If you would also want to include tags it would go below the categories and custom taxonomies will be displayed below the tags list.

Now I'm going to include an icon of a folder to appear nest to each category.

[netsposts shortcode_id='include-exclude' thumbnail='true' list='4' show_categories='true' show_category_icon='true']

Hello world!
Published 10/19/2020 in Agave Plugins Download Files
Welcome to Agave Plugins for WordPress and more.... This is your first post. Edit or delete it, then start writing!read more ❯
Pacific
Published 4/4/2020 in Ocean Views
Pacific Ocean Sunset
The Pacific Ocean is the largest and deepest of Earth's oceanic divisions. It extends from the Arctic Ocean in the north to the Southern Ocean (or, depending on definition, to Antarctica) in the south and is bounded by the continents of Asia and Australia in the west and the Americas in the east.read more ❯
Rocky Mountains
Published 4/4/2020 in Mountain Ranges of the World
The Rocky Mountains
The Rocky Mountains, also known as the Rockies, are a major mountain range located in western North America. The Rocky Mountains stretch 3,000 km (1,900 mi) in straight-line distance from the northernmost part of British Columbia, in western Canada, to New Mexico in the Southwestern United States. The northern terminus is near the Liard River, while the southernmost point is near Albuquerque, adjacent the Sandia–Manzano Mountains. Located within the North American Cordillera, the Rockies are distinct from the Pacific Coast Ranges, Cascade Range, and the Sierra Nevada, which all lie farther to the west.read more ❯
Test Post 1
Published 9/1/2021 in Agave Plugins Private Support

If you would like a different icon you can replace what I have with a little CSS. If you use your inspector tool you'll see the following code.

.icon.ic-category { background: url(https://agaveplugins.com/wp-content/plugins/network-posts-extended/pictures/folder-open-solid.svg) no-repeat; }. Just replace the url with the url of the imag/icon you prefer and place the CSS in the customizer's CSS area.

Hello world!
Published 10/19/2020 in Agave Plugins Download Files
Welcome to Agave Plugins for WordPress and more.... This is your first post. Edit or delete it, then start writing!read more ❯
Pacific Ocean Sunset
Pacific
Published 4/4/2020 in Ocean Views
The Pacific Ocean is the largest and deepest of Earth's oceanic divisions. It extends from the Arctic Ocean in the north to the Southern Ocean (or, depending on definition, to Antarctica) in the south and is bounded by the continents of Asia and Australia in the west and the Americas in the east.read more ❯
The Rocky Mountains
Rocky Mountains
Published 4/4/2020 in Mountain Ranges of the World
The Rocky Mountains, also known as the Rockies, are a major mountain range located in western North America. The Rocky Mountains stretch 3,000 km (1,900 mi) in straight-line distance from the northernmost part of British Columbia, in western Canada, to New Mexico in the Southwestern United States. The northern terminus is near the Liard River, while the southernmost point is near Albuquerque, adjacent the Sandia–Manzano Mountains. Located within the North American Cordillera, the Rockies are distinct from the Pacific Coast Ranges, Cascade Range, and the Sierra Nevada, which all lie farther to the west.read more ❯