标签: 获取子站文章
-
作者帖子
-
我想在多站点的的主站上显示子站某一分类下的文章,子站文章的分类是固定的是继承主站的分类,这个怎么做,或者有什么插件,目前我自己做的是用代码把子站某一分类下的文章调出来了,但是分页没法做,分页没效果
最简单的方式还是说回
Network Posts Extended
这个插件,你多熟悉下插件的用法,然后自定义一个 shortcode 简码就行了。其他的需要固定的分类同步之类的,我们下个月会公开一批 WordPress SaaS 平台的建设方案,里面会包含系统化的处理方式。
有教程吗,从插件里进去的教程打不开
这个插件作者不讲究,写的内容比较乱,把使用方法全都写在了更新日志里。我全贴上来吧,自己用翻译软件看看。
The plugin is designed to share posts, pages, and custom post types from across entire 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.
LONG DESCRIPTION
The plugin is designed to share posts, pages, and custom post types from across entire 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. They are all listed at the end of this file.
SCREEN SHOTS
Single Column Default
Single Column with Blue Header and Thumbnail Dimmensions size=”240,160″
Double Column with Red Header
7.2.3
Fixed WordPress adding string to empty conditions.7.2.2
Added arguments to work with Woocommerce categories and tags.7.1.9
Added the ability to have shortcode just refresh the page listings without refreshing the page for multiple listings on the same page. Just add shortcode_id=』custom-id-you-choose』.
Note: All ID』s must begin with a letter. shortcode_id=』a12345′ is okay while shortcode_id=』12345′ is not okay.7.1.8
Removed dynamic links from showing on archive pages or when site excerpts are shown from the plugin.7.1.7
New attributes:
1. load_posts_dynamically='(true/false)』 – allows to load posts without refreshing page. Default false.
2. posts_preloader_icon='(url to icon)』 – Set custom icon url. This icon is displayed while posts are loading if 「load_posts_dynamically」 is true.
3. show_preloader_icon='(true/false)』 to hide default spinning icon. Default true.
4. default_thumbnail='(url to default image)』 – Must be the full url to the image you want to use.7.1.5
Fixed custom taxonomies links not working properly.7.1.4
Modifications:
1. show_custom_taxonomies is made to be able to accept taxonomy type list to filter what taxonomies will be displayed.
2. 「Author」 word in each post item is wrapped with span css class 「netsposts-author-label」 to stylize it.7.1.2
Added new feature that increases translation abilities by searching on posts whose language is a default for the site but then it gets found posts translations. After this it gets all additional information for these translated posts. So it isn』t needed to translate shortcode attributes for other languages. Just copy it. This feature runs automatically if WPML plugin is activated.7.1.1
Added the following arguments
1) Added arabic language support.
2) Created 『show_custom_taxonomies』
3) Created 『show_custom_taxonomy_icon』. – Shows green icon before each custom taxonomy
4) Checked 「excerpt length」 functionality. Plugin already contains both versions for letters and words:
excerpt_length/excerpt_letters_length and manual_excerpt_length/manual_excerpt_letters_length.
5) Added functionality to trim titles by words and letters: title_length/title_length_characters.
6) Plugin already inserted category css classes in form of 「category-category_slug」 in div.netsposts-content.
7) Made it to insert 「tags」 css classes in form of 「tag-tag_slug」.= 7.0.7
Fixed manual_excerpt_length= bug. Now works correctly. Added arguement remove_blog_prefix='(true or fals)』 if blog is installed in a subdomain or subfolder. Some people were getting a /blog after the permalinks.7.0.6
Fixed bug where sometimes the author link was not working correctly. Plus now it can list posts up to a 1,000 domains.= 7.0.5
Fixed some translations in the translation file.7.0.4
Fixed bug where subsites wouldn』t deativate on network deactivate7.0.1
Fixed taxonomy include not working.
Added include keyword in title. So the title must contain a certain word to be listed.
Added three css classes along with netsposts-content. blog-id, post-id, category-slug. This way you can give items separate styling based on the category or blog they belong to or you may target a specific post/page listing.6.8
Fixed include/exclude blog throwing PHP error on not functioning correctly.6.7
Assuring the plugin is WordPress 5.0 compatible.6.6
Added the following functionality:
Modifications list:
1) date_format is made to load blog』s date format if date_format=』settings』
2) Every date is automatically localized
3) The plugin loads active theme』s default thumbnail size if size=」parent theme」
4) Created a setting whether to load plugin styles or not.
5) Added a checkbox in the admin remove all styling from the css file.
And there is one additional thing. 「size」 attribute value can be any registered size and not even one that is created with our plugin. size=』h,w』6.5
Fixed ACF Custom Fields not showing globally6.4
Fixed thumbnail sizes not resizing.6.2
Fixed function which ACF changed on update so to be compatible again.6.1
Added the ability to output numerical and simple text based strings from the Advanced Custom Fields plugin. Important: Won』t do complicated fields because the output will just be converted to a long text string which will look like gibberish.6.0
Put back the class for the read more link. Verified stability with WordPress 4.9.85.9
When title was set to contain a link it lost it’s class so added a new class called “netsposts-posttitle-link” to make the customization via css easier. So when title is not linkable the class is “netsposts-posttitle” and when it is a link the class is “netsposts-posttitle-link”.5.6
Changed some css by changing the following html code: id=”block-wrapper" to class=”netsposts-block-wrapper” and id=”netsposts-paginate” to class=”netsposts-paginate” and id=”netsposts-menu” to class=”netsposts-menu”5.5
Added two new arguments – hide_source=’true’ hide_excerpt=’true’. Default false (will automatically show hide_source and hide_excerpt unless set to ‘true’).3.9
Added the ability to create custom fields and order your posts as such. For example if you create a custom post type to show upcoming events you can list them in either ASC (ascending) or DESC (descending) order. Plus you can show past events or events that are occurring today. Plus changed the link structure from using post ID to using permalinks.3.8
Fixed bug where post_height=” stopped working.3.7
Added the ability to keep original image quality in plugin admin menu. Keep original image is defaulted to on and by-passes WordPress automatically choosing compressed version of image. Check the box to turn this feature off.3.6
Added ability to open links in new window.3.5
Updated way WordPress runs shortcode to keep up with security standards plus fixing taxonomy error. Now compatible with WordPress version 4.8.3. Plus added to be able to call taxonomies by keyword using partial category/tag name.3.4
Fixed error in show_categories php code which was showing parse error in error_log file.3.3
Fixed use_shortcode_in_excerpt function now works again. Added the argument show_categories so if you would like to include a link to the category page you may add show_categories=’true’3.2
Fixed syntax error created in some environments.3.1
Corrected the ability to process shorcodes in the excerpt field. Now must use: use_shortcode_in_excerpt=’true’. You must use a plugin like Code Snippets or add the following code to your functions.php file which allows you to process shortcodes in the excerpt box of posts and if activated pages also. without the backticks. The above plugin will not want you to include the . Just enter it as so: add_filter(‘the_excerpt’, ‘do_shortcode’);. If your functions.php file has an opening php tag just insert the latter snippet also.3.0
Added the ability to process shortcodes in the excerpt field. Just set filter_excerpt=’true’. That is if you have a shortcode in the posts excerpt field in the admin page or have auto_excerpt=’true’ it will process all shortcodes.2.9
Added ability to use shortcodes in dynamic url.2.8
Fixed css bug2.7
Fixed Call to Function errors.2.6
Fixed use_layout=’inline’ so it looks like it was supposed to. Has Title, meta-info and content floating to the right of thumbnail.2.5
Fixed bug where content was flowing outside of content area when listed on a page.
I have added the following arguments:
* full_text=’true’ will show entire blog content (default – false)
* use_layout=” (default or inline – the default is set to use_layout=’default’). When set to inline all meta data and content will be aligned to the right of the image.
* align_thumbnail=” (default is left. May now choose the image to align to the right of the text if use_layout=’inline’ is chosen.
* wrap_excerpt_container_start=’CSS Code Here or anything else for that matter’ wrap_excerpt_container_end=”. So if you want to add a class to the excerpt/content area you may do so by using wrap_excerpt_container_start=’‘ wrap_excerpt_container_end=’‘.
2.4
Fixed bug where it stopped working with posty_type=’page’ and now works with custom post types. So if you make a post type called listing you may now add, post_type=’listing’.2.2
Fixed incompatibility problem between browsers. Now tested and works with Firefox, Chrome and Microsoft Edge. Should work with Safari and Opra browsers also.2.0
Added the ability to resize images and use them as the default thumbnail.1.5
This plugin now will show prices for commerce sites using the Woocommerce or WP eStore plugins.1.4
The plugin can now list post and pages from any subomain/blog including woocommerce and eStore. No longer syntax error created.1.3
Removed below custom class and added checkbox to remove read more link on excerpts.
Added text box to remove read more link individually by inserting the title of post/page.
Moved the location of the plugin from the tools menu to inside the settings menu for less confusion.
It is now named ‘Network Posts Ext’ with the quotes of course.1.2
Added custom class to plugins net_posts_extended.css file .netsposts-read-more-link
This way you can remove the read more links from the excerpts by using the following attribute:
a.netsposts-read-more-link { visibility: hidden; } or a.netsposts-read-more-link { display: none; }1.1
Added ability to list posts in specific order by date, title or page (pertains to post_type=’page’ only).
Arguments now work with paginate=’false’ random=’true’
Fixed call to function error1.0
Added two more arguments.
manual_excerpt_length=’ ‘ plus post_height=’ ‘0.9
Added the function to be able to use your own custom classes in tools area.
Plus added the following arguments:
column_width (default (px): 200)
title_color (default: black)
text_color – color of text. Examples text_color=’red’ or text_color=’#ff0000′. Both will have the texts color turn red.
meta_info – Default true0.8
wrap_title_start,wrap_title_end – wrap_image_start,wrap_image_end – wrap_text_start,wrap_text_end.
meta_width – Same as title length except in percentage to shorten long meta data.
Added the ability to show posts or pages randomly using the following argument: random=’true’
The list= argument works with pagination= true or false (default: false)0.10
Added the ability to have custom thumbnail sizes created on image upload.
You will be able to have image sizes that are also rectangular for better matching on listing your pages. For example an image with a width of 300px and height of 200px.LIST OF ARGUMENTS
= Network Posts Extended Shortcodes and Arguments =[netsposts include_blog=’1,2,5′ days=’30’ taxonomy=’news’ titles_only=’false’ show_author=’true’ thumbnail=’true’ size=’90,90′ image_class=’alignleft’ auto_excerpt=’true’ excerpt_length=’150′ show_author=’true’ paginate=’true’ list=’5′]
Shortcodes go in text menu on posts editor pages. You may also add them to your sidebar via the WordPress built in text widget. Also paste under text menu.
INCLUDING AND/OR EXCLUDING PAGES, POSTS, CATEGORIES, AND BLOGS
include_post – list of posts/pages that you want to include (example: include_post=’5′ or include_post=’5,8,153′ for multiple posts.exclude_post – list of posts/pages that you want to exclude (example: exclude_post=’5′ – exclude_post=’5,8,153′
include_blog – list of blogs, with the posts which will be displayed – include_blog=’5,8′ (default all blogs)
exclude_blog – list of excluded blogs (default none) (works only if include_blogs argument is not present)
filter_excerpt – The plugin will now process and show shortcodes in the excerpt field. Just set filter_excerpt=’true’ ( Default: false )
taxonomy – list of categories to include in list. Default is all categories. Example: taxonomy=’books’ or taxonomy=’digital-books,product,news’ for multiple categories. Use slug of category for the taxonomy name.
taxonomy_type can have 3 values – category, tag, all. Example: taxonomy_type=’tag’ taxonomy=’records’. That way if there is a category and a tag both named ‘records’ you may choose which to select. To include both just separate with commas. Example: taxonomy_type=’tag,category’. You can only select woocommerce taxonomy_type if post_type=’product’ which is a custom woocomerce post type.
If post_type is ‘product’ taxonomy_type can be ‘product_tag’, ‘product_cat’ or both.= Miscellaneous show/hide arguments +
days – how old in days the post can be (default 0′ – no limit) Example: days=’10’ will only show the posts/pages which have been created within the last ten days.
titles_only – if true shows titles only (default false) Example: titles_only=’true’ will only show the titles. Not the image or excerpt.
show_author – if true shows a posts author (default false) Example: show_author=’true’
To hide the source area just add the following argument to the shortcode – hide_source=’true’ will hide all the meta_info like author, date created, etc…
hide_excerpt=’true’ will hide the text, that is the whole excerpt field.show_categories= – If set to true then it will show a list of categories along with the meta data.
show_tags= If set to true then will show a list of tags the same way as the categories above.
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 the words in the title.
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』. If 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 categoryies 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.
THUMBNAILS
thumbnail – if true shows thumbnails (default false) Example: thumbnail=’true’size – Displays custom thumbnail size. So if you have a specific thumbnail size you』d like to show enter the name here. Example size=’custom-thumbnail-name’
image_class – CSS class for image (default post–thumbnail) Example: image_class=’custom-image-class’
EXCERPTS
auto_excerpt – if true an excerpt will be taken from post content, if false a post excerpt (shows the short description in the excerpt box. Note you will need to use a plugin to show this box when creating pages instead of posts) will be used (default false).excerpt_length – the length of excerpt (in characters) (auto_excerpt should be true)(default 400′) Example: excerpt_length=’500′ will show the first 500 characters.
manual_excerpt_length – You can set the length of the manual excerpt. For example if someone has 500 words in the manual excerpt field it may be trimmed down to 400 like so: manual_excerpt_length=’400′ (defaul 9999)
LISTING DESIGNS
post_type – type of posts (default post) Example: post_type=’page’ will show pages not posts in the list. To show posts either don’t include this argument (since posts are default) or use post_type=’post’. Now works with custom post types. So you may add post_type=’mycustomposttype’.full_text – full text instead of excerpt (default false) Example: full_text=’true’ will show entire text in content field in list.
SHOWING DATE
date_format – format of the post date (default n/j/Y). This will show January 2 1963 for example. If you would like to show the date first just use: date_format=’j/n/Y’.CUSTOM HTML
wrap_start, wrap_end – you can wrap the posts for example: wrap_start=’‘ wrap_end=’‘
wrap_title_start,wrap_title_end – wrap_image_start,wrap_image_end – wrap_text_start,wrap_text_end wrap_excerpt_container_start=”,wrap_excerpt_container_end=” . Use the same way as wrap_start,wrap_end above. But will only wrap given argument.
page_title_style – style for the page title (default: none) Example: page_title_style=’italic’ will make the title italic. For bold you may use: page_title_style=’bold’ for italic and bold use: page_title_style=’italic,bold’
Miscellaneous List Arguments – Pagination Links and Order Post/Page by Properties
end_size – how many numbers on either the start and the end list edges (used for pagination) Example: end_size=’3′ will show the first and last three pages as links in numerical form.
mid_size – how many numbers to either side of current page, but not including current page (used for pagination)
order_post_by – Sort in ascending (default value) and descending order via the following arguments – Ascending: order_post_by=’alphabetical_order’ order_post_by=’date_order’ order_post_by=’page_order’ and descending: order_post_by=’alphabetical_order desc’ order_post_by=’date_order desc’ order_post_by=’page_order desc’ (note: descending must be surrounded by single or double quotes because of the empty space after page_order
Pagination – When list is to have multiple pages
paginate – if true the result will be paginated (default false) Example: paginate=’true’ will break the list in to multiple pages by the list argument.
list – how many posts per page (default 10) Example: list=’20’ will show the last 20 posts or pages. If paginate=’true’ is used above then will break the list in to pages showing 20 posts or pages on each page.
prev_next – Whether to include the previous and next links in the list or not (used for pagination. Default: true)
prev – the previous page link text. Works only if prev_next argument is set to true. (Default: « Previous)
next – The next page text. Works only if prev_next argument is set to true. Example: next=’New Posts’ will replace the default – Next – with – New Posts. (Default: Next »)
random – Set to true to show posts randomly. To show an x amount of posts randomly make sure the list argument is set to the amount you want. (Default: set to false)
CUSTOM ARGUMENTS
TITLES
title – custom title (default: none) Example: title=’Joe’s Favorite Bicycles’title_color – Color of the title text. Example: title_color=’red’ or title=’color:#ff0000′ both will give you a color of red. (Default black)
title_length – Cuts off the title at X amount of characters so won’t make long wrap around which looks ugly. The length is in characters including spaces and symbols (Default 999)
include_link_title – This will now make all titles clickable (default false). If you want the titles to also link to the post or page set this argument to true. Example: include_link_title=’true’
exclude_link_title – This will exclude certain posts/pages from the title being clickable. For example if you don’t want the title to link to posts 8,45,47 you would use: exclude_link_title_posts=’8,45,47′
show_title= Adds the ability to hide titles. For example show_title=’false’ will not show the title. Default is true.
CUSTOM COLUMN DESIGNS
column – number of columns (default: 1)column_width – Width of column in pixels. Example column_width=’250′. (Default: 200)
post_height – Sets the default height for all posts. Recommended for 2 column mode. For example if manual_excerpt_length=’400′ or excerpt_length=’400′ and you want posts with less of an excerpt to have same dimensions use this feature. post_height=’300′ will give a standard height of 300 pixels. So if post has less characters of text will still keep square shape so titles line up nicely.
meta_info – Example: meta_info=’false’ (Default ‘true’)
meta_length – Example: meta_length=’75%’ (Default 100%)
menu_name – name of the menu (should be created in Appearance > Menu)(default: The one created in Appearance > Menu)
menu_class – CSS class for the menu. Example menu_class=’menu-class’. Separate multiple classes with commas.
remove_blog_prefix=’true’ will remove the /blog if multisite is installed in a subdomain or subfolder. Default is false.
container_class – the CSS class that is applied to the menu container
use_shortcode_in_excerpt – If set to true any shortcodes that appear in the excerpt will be processed. Default: false. Note: You must activate the ability to have your site be able to process shortcodes in excerpt field.
show_categories – If set to true will also include a link to the category archive page. show_categories=’true’ default is false.
Added ability to call all categories that contain certain keyword or part as in the following example:If you type ‘test-%’ it will find test-1, test-2, test-3 etc.I.e. it will find categories that starts with ‘test-‘. if you type ‘%test’ it will find categories that ends with ‘test’ word.
link_open_new_window=’true’ (default false) for all posts and link_open_new_window=’1,2,3,4,5′ for posts with given ids.
Taxonomy offsets: 1) taxonomy_offset_names=」 and 2) taxonomy_offsets=」. So for example if you wanted to offset three different categories it would look like so: [netsposts taxonomy_offset_names=』books,flowers,sports』 taxonomy_offsets=』5,4,10′] then books would be offset by 5, flowers 4, and sports 10. Offsets means it will skip the X most recent posts.
Using Custom Image Sizes:
Under settings > Network Posts Ext menu you will see a box to add a custom image size. You may name it anything you like and use the default alias name or your own. Wants created you must include the following in your shortcode:thumbnail=’true’ size=’Name of Alias’. For example if what is listed in the alias box is 600×400 then it would be size=’600×400′ so your thumbnails will have a size of 600px wide and 400px high. You may change the diplayed size of these images using custom css.For example you may create a class called img-size-300×200 and change the displayed image size thus: .img-size-300×200 { height:300px;width:200px; }. Then add this to the shortcode: image_class=’img-size-300×200′. To use default thumbnail size use size=’parent theme’ or to use any of the parent theme』s default sizes use size=’h,w’
align_image=’right’,align_image=’left’.
use_layout=’default’,use_layout=’inline’Advanced Custom Fields – To add the field with the meta info just use the argument include_acf_fields=』name-of-custom-field-slug』. It will appear with the label name followed by the input (default false). If you』d like to include the label just add the argument hide_acf_label=’false’.
Note: All fields are surrounded by tags. If you』d like to change them you will have to add a bit of coding. Here』s some examples.Network Activated: Now you can network activate and have full control in the admin menu under settings which site owners can resize images. You may have them resize images just on their own site or globally or not allow them to resize images at all. Works great sold as a premium feature.
New Arguments
show_title You may now hide the title by adding the argument show_title=’false’ Default is true.must_include_categories – shows posts that contains all the categories in the list. Example [netsposts must_include_categories=’read,green,orange’] So if the post isn』t listed in all three categories it won』t show.
filter_by_title_keywords – display posts that contains one ore more of provided words Example if filter_by_title_keywords=’off-roading’ then only posts with the word off-roading anywhere in the title will display.
show_tags If show_tags=’true’ then will show a linked list of tags. Note: The links will go to the archive directory of given tag. Not the post.
show_categories Same arguments as show_tags except categories will be displayed.
show_rating Works with my Post Reviews plugin to show the posts star rating along with the title. Default false.
page_has_no_child – Will only show posts that have no child pages. This is great for archive pages.
show_category_icon= If set to true shows an open folder next to each category listing. Default false.
show_tag_icon= If set to true shows a price tag in pinkish red next to each tag listing. Default false.
All Below Arguments Work With ACF (Advanced Custom Fields) Plugin
order_post_by_acf_date (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. The nearest coming event listed on top.acf_date_format (n,j,y) If you ACF plugin you can re-order the way the date is displayed using the following guidelines. https://www.php.net/manual/en/function.date.php
exclude_all_past_events (field_name) If you have an events setup with an ACF field named events_date then if you 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 (field_name) 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_field (field_name) Displays the following fields along with the other content. Like if you have a link field it will display here.
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.
add_link_to_acf (true/false) default false Will contain a permalink to the post for all included acf fields.
End ACF Plugin Dependent Arguments
domain_mapping (site_url / home_url) If you have domain mapping set up on your site 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://mywonderfullsite.com then the link will look like https://mywonderfullsite.com/post-name (or however you set up your permalinks). Otherwise if you chose domain_mapping=’home_url’ it will display as: https://mywonderfullsite.mainblogsite.com/post-name.read_more_text (any text you put here will replace the read more text) default is read more… To have it say continue reading just use read_more_text=’continue reading…’
1) Added arabic language support.
2) Created 『show_custom_taxonomies』
3) Created 『show_custom_taxonomy_icon』. – Shows green icon before each custom taxonomy
4) Checked 「excerpt length」 functionality. Plugin already contains both versions for letters and words:
excerpt_length/excerpt_letters_length and manual_excerpt_length/manual_excerpt_letters_length.
5) Added functionality to trim titles by words and letters: title_length/title_length_characters.
6) Plugin already inserted category css classes in form of 「category-category_slug」 in div.netsposts-content.
7) Made it to insert 「tags」 css classes in form of 「tag-tag_slug」.New attributes (added version 7.1.7):
1. load_posts_dynamically='(true/false)』 – allows to load posts without refreshing page. Default false.
2. posts_preloader_icon='(url to icon)』 – Set custom icon url. This icon is displayed while posts are loading if 「load_posts_dynamically」 is true.
3. show_preloader_icon='(true/false)』 to hide default spinning icon. Default true.
4. default_thumbnail='(url to default image)』 – Must be the full url to the image you want to use.Network Posts Extended v 7.1.9
Attributes: 1. shortcode_id – set HTML id for root posts element.
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 recomend the ID』s should be named on a per page basis. Let』s say you have four instances of the shortcode on the same page. I would give the first shortcode and 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.
Note: Each shortcode must have a unique id for this to work. Plus html5 requires that an ID name be only used once per page. That is if you have and ID called myfirstid that can』t be used again on the same page.
Note: All ID』s must begin with a letter. shortcode_id=』a12345′ is okay while shortcode_id=』12345′ is not okay.Network Posts Extended v.7.2.5
Added attributes:
1) exclude_read_more_link – Hide 『read more』 link on certain pages.Removed Attributes:
1) column
2) column_width
3) page_title_styleFor a complete tutorial please visit: Agave Premium Plugins NPE Tutorial
Screenshots
FAQ
Q) Why is the plugin is only pulling in posts from main blog only?
A) There are two answers to this question. 1) You have include_blog=’1′ inside the shortcode. Simply remove this. 2) The other blogs are not setup as public. When you go in to network admin area and visite sites > (any subsite) > edit you will see a list of four checkboxes. Make sure the one marked public is checked. If a site is marked as private, spam, etc… anything other than public this plugin will not show it (as it shouldn』t for security reasons).Q) Should I network activate the plugin?
A) You may network activate the plugin so it is available on all sites or activate individually. When network activated there will be a new menu for the plugin under settings > Network Posts Thumbnails which will allow you to give certain permissions to blog owners when it comes to the thumbnail sizes. You may allow to create new sizes just on their blog or across the entire network which will affect everybody. I recommend only to allow it for their blog only. This allows you to also include it as a custom feature if you want to charge for this capability.Q) May I only include an x amount of posts that I choose?
A) Yes, use include_post= and put in your posts in comma separated format surrounded by double quotes.
Example include_post=’5,78,896′.Q) My title is too long and looks ugly, anyway I can shorten it?
A) You may shorten it using the argument title_length=’10’ will rounded it off to the last complete word before it reaches 10 characters.Q) I would like to just show an X amount of random posts on the home page. Is it possible?
A) Use the following arguments: random=’true’ and list=’10’ will show ten different posts randomly whenever the page is loaded. If you add list=”15″ it will show fifteen different posts randomly.Q) May I order my posts in specific order by date or title?
A) Yes you may give specific ordering of your posts or pages via alphabetical order (by title), by date or page or post ID specific order.Q) Does this plugin list pages from woocommerce?
A) Yes it now does as of version 0.1.4. You may list via page/post id or via taxonomy=’custom woocommerce category’. Woocommerce default directory/taxonomy is product show you would just use the argument taxonomy=’Product’ which is the title of the directory. (Not case sensitive)
Note: Also works with Tips and Tricks eStore plugin.Q) Will this plugin also include the prices from the products I create with the Woocommerce and eStore plugins?
A) Yes it will including the following argument: include_price=’woocommerce’ or include_price=’estore’. If for some reason you have both plugins installed you would use include_price=’estore|woocommerce’ if you want to list them both.Q) When I use the following argument wrap_start=”
” and wrap_end=”” the text does not change color.
A) That is because since double quotes are used after the = sign they must be changed to single quotes and use double quotes in the html. For example you would have to have wrap_start=’‘. Notice the double quotes in the html? Do not forget to change the closing argument to wrap_end=’‘
Q) Does this plugin work with custom post types. That is post_type=’custom-post-type’.
A) Yes it now works with custom post types.Q) Can I show full post from any blog on any site?
A) Yes you can by using the following argument full_text=’true’Q) I have custom image sizes I have already created and uploaded. How can I use them with your plugin without having to go through the process of re-creating image sizes with your plugin?
A) You can use them directly as a featured image or you can install the plugin https://wenpai.org/plugins/featured-image-from-url/ and put in the link directly to the images. This plugin will automatically switch to the one listed here. Don’t forget to change size=’H,W’ to the dimensions of the featured image.Q) The default layout is quite ugly. How do I improve it?
A) Using css I have made this plugin very flexible. It now contains two default layouts. Their names are “default” and “inline”. You may choose either one by using use_layout=’default’ or use_layout=’inline’.Q) Can I use shortcode attributes in dynamically created url?
A) Yes you may now use the shortcode attributes in a url. Example: https://localhost/wordpress/home-page/?column=infinite&include_blog=1,2,3&taxonomy=wordpress-develop,second-postsQ) Where do I put the shortcodes?
A) Paste the shortcode on any page, post or custom post type using the Text not the Visual area of the posts editor field.Q) How do I use this plugin in widgets?
A) Use the default WordPress text widget and post the code in there under the Text not Visual code area so it will not mess with the shortcode. This widget is now automatically shortcode ready. No need for a special widget or plugin to activate shortcodes in widgets.Q) Is it possible to include custom post type meta information?
A) As long as you use the Advanced Custom Fields Plugin it will be possible to do so. Read the readme.txt file for arguments to add to the shortcode.Q) Can I offset posts by skipping the three most recent posts and choose which category I』d like to offset?
A) Yes you now can with the following two arguments. 1) taxonomy_offset_names=」 and 2) taxonomy_offsets=」. So for example if you wanted to offset three different categories it would look like so: [netsposts taxonomy_offset_names=』books,flowers,sports』 taxonomy_offsets=』5,4,10′] then books would be offset by 5, flowers 4, and sports 10. To offset by tags include the following argument: taxonomy_offset_type=」 so it will now work with tags. As of now the only argument it accepts are category, or tag, or any. So if you want to offset by certain tag you would add taxonomy_offset_type=』tag』. Default it offsets by post type when argument is not used.Q) I have my my multisite installed in a subfolder and the permalinks sometimes adds a /blog/ to the permalink. How can I remove this?
A) Add the following argument: remove_blog_prefix=’true’.Q) Will this plugin work on a non-multisite/single site installation?
A) No it will not but you may get the single site version here: Single Site Posts Extended -
作者帖子
- 哎呀,回复话题必需登录。