Необычные варианты вывода записи в wordpress с the_content и the_excerpt

Recenzje

http-equiv=»Content-Type» content=»text/html;charset=UTF-8″>lass=»plugin-reviews»>

The plugin, of course, requires knowledge of WordPress. However, it will fully repay for attention to them. Intuitive: the author has provided all the options for applying excerpts.

Exactly what I need, and support (for a question I shouldn’t have needed to ask) was exceptionally quick. Thanks!

Useful plugin and easy to use!

As the title says

Paid-level support for a free plugin? It doesn’t get any better than that. Thank you!

I was looking for a plugin to modify the length of the excerpt, this one does this and many other things, so it is really fantastic!
Thank you to the developers!

Further Discussion

Where using WordPress post excerpts often gets complicated is: the whole system overlaps, and so if you’re coming in on an existing project it’s often very hard to tell what’s already been done to the default WordPress filter functionality by the time you get to it.

I mention this problem not to “solve” it—it’s an issue with event-driven systems like WordPress in general—but to clue you in as to the type of issue to look for if your excerpts simply aren’t behaving as you expect. Chances are, somebody’s changing them already, in a theme, plugins, or both. The in your theme and child theme are good first guesses, so search them for the string “excerpt” to see what might be going on.

Description

This plugin adds a simple post-type drop-down to the post editor interface, allowing you to reassign any post to a new post type. It allows you to switch post’s type while editing your post.

Supported Types

The plugin can convert nearly every combination of posts, pages, and even custom post types:

  • Page to Post
  • Post to Page
  • Post to Custom
  • Custom to Custom

As of 3.0.0, support for switching to or from Attachments was removed. This may come back in a subsequent version.

Invisible post types, such as revisions, menus, etc., are purposely excluded. But, if you need to access invisible post types, you can adjust the boundaries using the ‘pts_post_type_filter’ filter.

Bulk Editing

With bulk editing (thanks to Matthew Gerring) you can select all the posts in a certain type and convert them to a new type with one quick action.

Reviews

http-equiv=»Content-Type» content=»text/html;charset=UTF-8″>lass=»plugin-reviews»>

The plugin, of course, requires knowledge of WordPress. However, it will fully repay for attention to them. Intuitive: the author has provided all the options for applying excerpts.

Exactly what I need, and support (for a question I shouldn’t have needed to ask) was exceptionally quick. Thanks!

Useful plugin and easy to use!

As the title says

Paid-level support for a free plugin? It doesn’t get any better than that. Thank you!

I was looking for a plugin to modify the length of the excerpt, this one does this and many other things, so it is really fantastic!
Thank you to the developers!

Log zmian

2.4.6

  • Added feature: Customize button HTML (PRO version)
  • Fixed bug: post is password protected
  • Updated settings page
  • Updated compatibility for WordPress 4.9

2.4.4

  • Excerpt method by 1st paragraph now available in FREE version!
  • Excerpt method by 2nd paragraph now available in FREE version!
  • Excerpt method by 3rd paragraph now available in FREE version!
  • Fixed various bugs

2.4

  • Fixed bug: HTML validator error because of inline style
  • Fixed bug: password content not displayed correctly
  • Fixed bug: WordPress shows its read more link when using tag
  • Added feature: Remove theme’s featured image when ECAE uses featured image to prevent double images
  • Added feature: user can now select the featured image thumbnail size to show
  • Added feature: user can now use featured image for „Excerpt” field content
  • Added feature: „read more text” and „text before link” now compatible with WPML
  • Premium user bug fix: can’t load the license page
  • Updated compability for WordPress 4.7

2.3.2

  • Fixing post type selection on advanced excerpt location
  • Fixing post editor error that affects some users
  • Fixing page excerpt function

2.2.5

  • Add an ability to make the button inline with the content
  • Add an ability to make the button font same as content font
  • Add plugin updater
  • Fix known bugs

2.2.0

  • Add disable excerpt on RSS Feed option
  • Add button shortcode
  • Add German translation
  • Add French translation
  • Add Spanish translation
  • Fix known bugs

2.1.5

  • Add new advanced excerpt location options
  • Add new excerpt size options in each location
  • Improved translation
  • Fix known bugs

2.0.6

  • Add option to strip empty HTML tags
  • Add option to change special method (change between yes and no to if there is a fatal error)
  • Change behavior for position method left and right (premium edition)
  • Fix known bugs

2.0.5

  • Add image position method: left, right, center, float left, float right (premium edition)
  • Add image width and image margin options
  • Fix known bugs

2.0.2

  • Add new excerpt method: show 1st, 1st – 2nd and 1st – 3rd paragraph (premium edition)
  • Add option to change font size (premium edition)
  • Updated display image options
  • Fix known bugs

2.0.0

  • Updated admin UI, more easy and intuitive
  • Add select font option (premium edition)
  • Add select button theme option (premium edition)
  • Add custom css option
  • Add front page excerpt option
  • Fix known bugs

Reviews

http-equiv=»Content-Type» content=»text/html;charset=UTF-8″>lass=»plugin-reviews»>

Good, but issue appeared in my website that my posts written in two languages(English/Arabic) , when converting the posts to pages the second language posts disappeared.

well done

Perfect and simple!

Works like expected, easy and helpfully!

Thank you!

I made a large amount of pages instead of them being posts. I was able to quickly fix them in a matter of seconds. Awesome job with this plugin! Thanks.

I had multiple post types I needed to combine and I was dreading the process of doing it manually or writing a custom script to handle it. This plugin solved my problem in seconds!

Description

This plugin adds several improvements to WordPress’ default way of creating excerpts.

  1. Keeps HTML markup in the excerpt (and you get to choose which tags are included)
  2. Trims the excerpt to a given length using either character count or word count
  3. Only the ‘real’ text is counted (HTML is ignored but kept)
  4. Customizes the excerpt length and the ellipsis character that are used
  5. Completes the last word or sentence in an excerpt (no weird cuts)
  6. Adds a read-more link to the text
  7. Ignores custom excerpts and use the generated one instead
  8. Theme developers can use for even more control (see the FAQ)

Most of the above features are optional and/or can be customized by the user or theme developer.

Banner image credit – chillihead

Original plugin author – basvd

Useful Resources

Changelog

4.3.7 ( July 10th, 2020 )

  • New – Option to link the whole excerpt to the single post page
  • Fix – Issue with “sentence finish” when there is a number with decimal points
  • Fix – Updated POT file for translations

4.2.9 ( May 27th, 2019)

  • New – Filter for developers to change the read more text. The filter is advanced_excerpt_read_more_text
  • Tweak – The read more text option now accept shortcodes

4.2.8

  • New – Screen reader text is now optional, can be enabled in the options
  • New – Added option to remove the “read more link” if the full post content is shown
  • New – Title can be included in the “read more link” by adding {title} to the option

4.2.3

  • Fix: The “Remove all tags except the following” wasn’t excluding tags as expected
  • Fix: Call on the hook to improve excerpt rendering
  • Fix: Only honor the “Only filter when there’s no break (<!–more–>) tag in the post content” setting when hooking into filter
  • Improvement: Improve backwards compatibility by reverting back to using for the base excerpt text
  • Improvement: Added the filter allowing users to skip excerpt filtering on a per excerpt basis

4.2

  • Feature: Toggle excerpt filtering when there’s no break (<!–more–>) tag in the post content
  • Feature: Toggle excerpt filtering for the and functions
  • Feature: Toggle excerpt filtering on certain page types
  • Improvement: Added HTML5 tags to the allowed tags list
  • Improvement: Options are now automatically removed from when the plugin is deleted from the dashboard
  • Improvement: Added several WordPress filters, allowing developers to extend/modify the default functionality of the plugin
  • Improvement: Additional strings were made i18n friendly
  • Improvement: All options are now stored in one row in wp_options rather than one row per option
  • Improvement: Several UI elements have be reworded and styled differently to improve user experience
  • Fix: Now works with themes using on archive pages (i.e. WordPress default themes and others)
  • Fix: Notices/warning were appearing when the options were saved while having a checkbox option unchecked
  • Fix: The “Read More” link was being incorrectly appended into certain HTML tags, e.g. table tags and list tags

4.1

  • Fix: Template function with custom options works again
  • Fix: Data before header bug (retro-fixed in 4.0)
  • Feature: Template function also works with array-style parameters
  • Removed multibyte support
  • Removed PHP 4 support (WP 3.2+ users should be fine, others should update)
  • Better code testing before release!

4.0

  • Feature: Brand new parsing algorithm which should resolve some running time issues
  • Feature: Options to finish a word or sentence before cutting the excerpt
  • Fix: A few small bugs

Best Practices For Posting # Best Practices For Posting

You can say or show the world anything you like on your WordPress site. Here are some tips you need to know to help you write your posts in WordPress.

Practice Accessibility

To be compliant with web standards for accessibility, be sure to include ALT and TITLE descriptions on links and images to help your users, such as <a title=”WordPress.ORG” href=”https://wordpress.org/“>WordPress.ORG</a>.

Use Paragraphs

No one likes to read writing that never pauses for a line break. To break your writing up into paragraphs, use double spaces between your paragraphs. WordPress will automatically detect these and insert <p> HTML paragraph tags into your writing.

Use Headings

If you are writing long posts, break up the sections by using headings, small titles to highlight a change of subject. In HTML, headings are set by the use of h1, h2, h3, h4, and so on.

Use HTML

You don’t have to use HTML when writing your posts. WordPress will automatically add it to your site, but if you do want control over different elements like boxes, headings, and other additional containers or elements, use HTML.

Spell Check and Proofread

There are spell check Plugins available, but even those can’t check for everything. Some serious writers will write their posts in a text editor with spell check, check all the spelling and proof it thoroughly before copying and pasting into WordPress.

Visual Versus Text Editor # Visual Versus Text Editor

When writing your post, you have the option of using the Visual or Text mode of the editor. The visual mode lets you see your post as is, while the Text mode shows you the code and replaces the WYSIWYG editor buttons with quicktags. These quicktags are explained as follows.

  • b – HTML tag for strong emphasis of text (i.e. bold).
  • i – HTML tag for emphasis of text (i.e. italicize).
  • b-quote – HTML tag to distinguish quoted or cited text.
  • del – HTML tag to label text considered deleted from a post. Most browsers display as striked through text.
  • link – HTML tag to create a hyperlink.
  • ins – HTML tag to label text considered inserted into a post. Most browsers display as underlined text.
  • ul – HTML tag will insert an unordered list, or wrap the selected text in same. An unordered list will typically be a bulleted list of items.
  • ol – HTML tag will insert a numbered list, or wrap the selected text in same. Each item in an ordered list is typically numbered.
  • li – HTML tag will insert or make the selected text a list item. Used in conjunction with the ul or ol tag.
  • code – HTML tag for preformatted styling of text. Generally sets text in a .
  • more – WordPress tag that breaks a post into “teaser” and content sections. Type a few paragraphs, insert this tag, then compose the rest of your post. On your blog’s home page you’ll see only those first paragraphs with a hyperlink (), which when followed displays the rest of the post’s content.
  • page – WordPress tag similar to the tag, except it can be used any number of times in a post, and each insert will “break” and paginate the post at that location. Hyperlinks to the paginated sections of the post are then generated in combination with the wp_link_pages() or link_pages() template tag.
  • lookup – Opens a JavaScript dialogue box that prompts for a word to search for through the online dictionary at answers.com. You can use this to check spelling on individual words.
  • Close Tags – Closes any open HTML tags left open–but pay attention to the closing tags. WordPress is not a mind reader (!), so make sure the tags enclose what you want, and in the proper way.

Workflow Note – With Quicktag buttons that insert HTML tags, you can for example click i to insert the opening tag, type the text to be enclosed, and click /i or Close Tags to insert the closing tag. However, you can eliminate the need for this ‘close’ step by changing your workflow a bit: type your text, select the portion to be emphasized (that is, italicized), then click i and your highlighted text will be wrapped in the opening and closing tags.

Opis

This plugin adds several improvements to WordPress’ default way of creating excerpts.

  1. Keeps HTML markup in the excerpt (and you get to choose which tags are included)
  2. Trims the excerpt to a given length using either character count or word count
  3. Only the ‚real’ text is counted (HTML is ignored but kept)
  4. Customizes the excerpt length and the ellipsis character that are used
  5. Completes the last word or sentence in an excerpt (no weird cuts)
  6. Adds a read-more link to the text
  7. Ignores custom excerpts and use the generated one instead
  8. Theme developers can use for even more control (see the FAQ)

Most of the above features are optional and/or can be customized by the user or theme developer.

Banner image credit – chillihead

Original plugin author – basvd

Useful Resources

Log zmian

4.3.7 ( July 10th, 2020 )

  • New – Option to link the whole excerpt to the single post page
  • Fix – Issue with „sentence finish” when there is a number with decimal points
  • Fix – Updated POT file for translations

4.2.9 ( May 27th, 2019)

  • New – Filter for developers to change the read more text. The filter is advanced_excerpt_read_more_text
  • Tweak – The read more text option now accept shortcodes

4.2.8

  • New – Screen reader text is now optional, can be enabled in the options
  • New – Added option to remove the „read more link” if the full post content is shown
  • New – Title can be included in the „read more link” by adding {title} to the option

4.2.3

  • Fix: The „Remove all tags except the following” wasn’t excluding tags as expected
  • Fix: Call on the hook to improve excerpt rendering
  • Fix: Only honor the „Only filter when there’s no break (<!–more–>) tag in the post content” setting when hooking into filter
  • Improvement: Improve backwards compatibility by reverting back to using for the base excerpt text
  • Improvement: Added the filter allowing users to skip excerpt filtering on a per excerpt basis

4.2

  • Feature: Toggle excerpt filtering when there’s no break (<!–more–>) tag in the post content
  • Feature: Toggle excerpt filtering for the and functions
  • Feature: Toggle excerpt filtering on certain page types
  • Improvement: Added HTML5 tags to the allowed tags list
  • Improvement: Options are now automatically removed from when the plugin is deleted from the dashboard
  • Improvement: Added several WordPress filters, allowing developers to extend/modify the default functionality of the plugin
  • Improvement: Additional strings were made i18n friendly
  • Improvement: All options are now stored in one row in wp_options rather than one row per option
  • Improvement: Several UI elements have be reworded and styled differently to improve user experience
  • Fix: Now works with themes using on archive pages (i.e. WordPress default themes and others)
  • Fix: Notices/warning were appearing when the options were saved while having a checkbox option unchecked
  • Fix: The „Read More” link was being incorrectly appended into certain HTML tags, e.g. table tags and list tags

4.1

  • Fix: Template function with custom options works again
  • Fix: Data before header bug (retro-fixed in 4.0)
  • Feature: Template function also works with array-style parameters
  • Removed multibyte support
  • Removed PHP 4 support (WP 3.2+ users should be fine, others should update)
  • Better code testing before release!

4.0

  • Feature: Brand new parsing algorithm which should resolve some running time issues
  • Feature: Options to finish a word or sentence before cutting the excerpt
  • Fix: A few small bugs

Changelog

2.4.6

  • Added feature: Customize button HTML (PRO version)
  • Fixed bug: post is password protected
  • Updated settings page
  • Updated compatibility for WordPress 4.9

2.4.4

  • Excerpt method by 1st paragraph now available in FREE version!
  • Excerpt method by 2nd paragraph now available in FREE version!
  • Excerpt method by 3rd paragraph now available in FREE version!
  • Fixed various bugs

2.4

  • Fixed bug: HTML validator error because of inline style
  • Fixed bug: password content not displayed correctly
  • Fixed bug: WordPress shows its read more link when using tag
  • Added feature: Remove theme’s featured image when ECAE uses featured image to prevent double images
  • Added feature: user can now select the featured image thumbnail size to show
  • Added feature: user can now use featured image for “Excerpt” field content
  • Added feature: “read more text” and “text before link” now compatible with WPML
  • Premium user bug fix: can’t load the license page
  • Updated compability for WordPress 4.7

2.3.2

  • Fixing post type selection on advanced excerpt location
  • Fixing post editor error that affects some users
  • Fixing page excerpt function

2.2.5

  • Add an ability to make the button inline with the content
  • Add an ability to make the button font same as content font
  • Add plugin updater
  • Fix known bugs

2.2.0

  • Add disable excerpt on RSS Feed option
  • Add button shortcode
  • Add German translation
  • Add French translation
  • Add Spanish translation
  • Fix known bugs

2.1.5

  • Add new advanced excerpt location options
  • Add new excerpt size options in each location
  • Improved translation
  • Fix known bugs

2.0.6

  • Add option to strip empty HTML tags
  • Add option to change special method (change between yes and no to if there is a fatal error)
  • Change behavior for position method left and right (premium edition)
  • Fix known bugs

2.0.5

  • Add image position method: left, right, center, float left, float right (premium edition)
  • Add image width and image margin options
  • Fix known bugs

2.0.2

  • Add new excerpt method: show 1st, 1st – 2nd and 1st – 3rd paragraph (premium edition)
  • Add option to change font size (premium edition)
  • Updated display image options
  • Fix known bugs

2.0.0

  • Updated admin UI, more easy and intuitive
  • Add select font option (premium edition)
  • Add select button theme option (premium edition)
  • Add custom css option
  • Add front page excerpt option
  • Fix known bugs

Description

Display Posts allows you easily list content from all across your website. Start by adding this shortcode in the content editor to display a list of your most recent posts:

Filter by Category

To only show posts within a certain category, use the category parameter:

Display as Post Grid

You can create a great looking, column-based grid of posts with a bit of styling. Here’s how!

List Popular Posts
You can highlight your popular content in multiple ways. If you want to feature the posts with the most comments, use:

You can also list most popular posts by social shares.

Include thumbnails, excerpts, and more
The let you control what information is displayed for each post. To include an image and summary, use:

You can use any image size added by WordPress (thumbnail, medium, medium_large, large) OR any custom image size added by your theme or other plugins.

Sort the list however you like
By default the listing will list the newest content first, but you can order by title, menu order, relevance, content type, metadata, and more.

List upcoming events
You can easily list upcoming events from any event calendar. Each plugin will require slightly different code.

Here are tutorials for popular event calendar plugins. If your plugin is not listed here, submit a support request and I’ll add it!

TutorialsOur tutorials cover common customization requests, and are updated often.

Full Documentation

  • for customizing which posts are listed (filter by category, tag, date…)
  • determine how the posts appear (title, excerpt, image…)
  • Template parts for Display Posts to perfectly match your theme’s post listings
  • Output filter for complete control over how the listing looks on your site
  • for even more powerful customizations for developers

Extensions

How to Create Excerpts of a Specific Character Length (Rather than Word Length) with the wp_trim_excerpt Filter

Used in a WordPress template file like  or , before the call to , the code above gives this result:

You can also use the code above in  (or a plugin) to change calls to  across your entire site.

Notes on the  Filter

The function  is the main function that actually generates an excerpt from WordPress post content (by shortening it to 55 words and adding “”). Before it finishes, it calls the  filter to let you filter the results.

We’re using the  filter to generate and  back our completely own excerpt behavior. For us, we run  to get the post content afresh. We then strip out whatever shortcodes may be in the post, use the  function to take the first 140 characters, add an  (“…”) tag to the end, and  back to the end.

wp post create

Создает новую запись.

Использование

wp post create                              

Можно указать Глобальные параметры и следующие:

The ID of the user who added the post. Default is the current user ID.
The date of the post. Default is the current time.
The date of the post in the GMT timezone. Default is the value of $post_date.
The post content. Default empty.
The filtered post content. Default empty.
The post title. Default empty.
The post excerpt. Default empty.
The post status. Default ‘draft’.
The post type. Default ‘post’.
Whether the post can accept comments. Accepts ‘open’ or ‘closed’. Default is the value of ‘default_comment_status’ option.
Whether the post can accept pings. Accepts ‘open’ or ‘closed’. Default is the value of ‘default_ping_status’ option.
The password to access the post. Default empty.
The post name. Default is the sanitized post title when creating a new post.
Post id of a post to be duplicated.
Space or carriage return-separated list of URLs to ping. Default empty.
Space or carriage return-separated list of URLs that have been pinged. Default empty.
The date when the post was last modified. Default is the current time.
The date when the post was last modified in the GMT timezone. Default is the current time.
Set this for the post it belongs to, if any. Default 0.
The order the post should be displayed in. Default 0.
The mime type of the post. Default empty.
Global Unique ID for referencing the post. Default empty.
Array of category names, slugs, or IDs. Defaults to value of the ‘default_category’ option.
Array of tag names, slugs, or IDs. Default empty.
Array of taxonomy terms keyed by their taxonomy name. Default empty.
Array in JSON format of post meta values keyed by their post meta key. Default empty.

Read post content from . If this value is present, the argument will be ignored.

Passing as the filename will cause post content to be read from STDIN.

Associative args for the new post. See wp_insert_post().

Immediately open system’s editor to write or edit post content.

If content is read from a file, from STDIN, or from the argument, that text will be loaded into the editor.

Output just the new post id.

Примеры

# Create post and schedule for future
$ wp post create --post_type=page --post_title='A future post' --post_status=future --post_date='2020-12-01 07:00:00'
Success: Created post 1921.
# Create post with content from given file
$ wp post create ./post-content.txt --post_category=201,345 --post_title='Post from file'
Success: Created post 1922.
# Create a post with multiple meta values.
$ wp post create --post_title='A post' --post_content='Just a small post.' --meta_input='{"key1":"value1","key2":"value2"}'
Success: Created post 1923.
# Create a duplicate post from existing posts.
$ wp post create --from-post=123 --post_title='Different Title'
Success: Created post 2350.

How to Change the Text of a Post Excerpt with the get_the_excerpt Filter

Used in a WordPress template file like  or , before the call to , the code above gives this result:

You can also use the code above in  (or a plugin) to change calls to  across your entire site.

Notes on the  Filter

Note that we’re using the  filter, which is different from the function . The relationship between the two is as follows: when  is called, one thing it does is filter itself using the  filter. And since the main behavior of  is simply to call  and  the result, calls to  will always pass through the  filter.

The filter itself passes you a string that is the full excerpt content that  would print onto the page. You can then  back your own custom string. In the example above, we used PHP’s  to change the text in specific ways, and then ed back the changed result.

Recenzje

http-equiv=»Content-Type» content=»text/html;charset=UTF-8″>lass=»plugin-reviews»>

I tried a few ways to add excerpts to an already full blog with 2017 theme… All others I tried failed, except this one. Easy, instant, done. Great.

Recently migrated a static site to WordPress and realide excerpts were missing!
The plugin has saved me hours of work.

ok good plugin — thanks

My home page had become blank after activating this plugin. All of the content of home page gone away and when I deactivated this plugin all the content come back.

It doesn’t work properly with the Post Grid Pro plug-in. It causes my grid posts to show the excerpt coming from the content, not using the excerpt field first. Note that the post grid does this properly if ECAE is not installed.

Also, just something to be aware of: if you have Front Page Excerpt setting set to Yes, it means that it will use the plug-in on the front page EVEN if you’re not showing posts. For example, I’m show a static page as my home page, and if I have that setting as Yes, it only shows x number of characters of the page content as my homepage.

It’s not a big deal because you can change that setting but it’s just weird that it acts on a page. Since when does a page have an excerpt?

Easy to configure and works like a charm. I might have to go for the upgrade on this one

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Adblock
detector