Get link from wpe_excerpt “read more” and move it
You might be interested in fetching the post’s link. get_permalink() and the_permalink() are the functions that returns the URL of current post, if that is what you want.
You might be interested in fetching the post’s link. get_permalink() and the_permalink() are the functions that returns the URL of current post, if that is what you want.
You can get an array of child pages using get_children. Use the parent page’s ID as post_parent. Once you have the array, you can loop through them and display whatever info you want. For example, to show the page title (linked) and the excerpt you could do: $args = array( ‘post_parent’ => $post -> ID … Read more
Ok I figured it out. My custom post type was called press_release not press-release, and instead of returning no results, wordpress was returning some arbitrary collection of results that were broken in weird ways.
Post List Widget with custom posts and editing the Read More Link
Excerpts and Custom Post Types
Apart from the horribly format issues you also have a typo: <?php $my_excerpt = $item->post_excerpt; if ($my_excerpt){ echo Str::limit($my_excerpt, 120);} else $content = ($item->post_content);{ $contentexcerpt = substr($content, 0, 150); echo $contentexcerpt, ‘…’; } ?> These lines: else $content = ($item->post_content);{ should be: else { $content = ($item->post_content); The parser registered a single line of code … Read more
You can check to see if the length of the excerpt is longer than the max count. if(strlen($excerpt) > $count){ $excerpt = substr($excerpt, 0, $count) . ‘…’; } … is the correct ellipsis character to use.
There is a build in meta box to handle custom excerpts. You just need to check the excerpt option box under screen options in your post screen, once checked, you will see the excerpt editor box below your WYSIWYG editor metabox. For custom post types, make sure that you set the excerpt as support feature … Read more
I’d suggest this plugin: https://wordpress.org/plugins/advanced-custom-fields/ It is very well maintained and documented. It will allow you to add one or more custom excerpt fields, manage the layout in the admin area and make them required so a post cannot be submitted without completing them.
By default, the page post type does not show the excerpt box like posts, but you can enable it like this(code goes into your theme’s functions.php file): add_action(‘init’, ‘excerpt_for_pages’); function excerpt_for_pages() { add_post_type_support( ‘page’, ‘excerpt’ ); } Then you can see the excerpt field when you edit your page. If not, make sure it is … Read more