Questions tagged [excerpt]

Excerpts are short texts or summaries

Filter by
Sorted by
Tagged with
0 votes
1 answer
2k views

The excerpt doesn't add Read more

I am confused about the behaviour of the_excerpt() and get_the_excerpt(). My objective is to have a manual excerpt and display a continue reading. I went through this article, and apparently ...
Trufa's user avatar
  • 105
0 votes
2 answers
1k views

Excerpt length: get 2 paragraphs

I have successfully implemented a solution from WPSE that trims the except to the first paragraph, but I'd like to change that to trim after the second paragraph instead. There's a link floating ...
codebloo's user avatar
1 vote
0 answers
183 views

Excerpt content

I want to display the title with content in result in search engine using excerpt. I see an answer for excerpt, See this, but I'm confuse where do I place this code... in function or wp-includes/...
User01's user avatar
  • 11
0 votes
1 answer
1k views

Make the title and [...] clickable in result search

I have search engine in my site. But when I try to search something, like "loan", the title is not clickable and the other contents are not displaying How to display the content and the title make as ...
User01's user avatar
  • 3
1 vote
1 answer
898 views

How can I show post excerpts on the tags page?

I want to see excerpts on my tags page (e.g., http://domain.com/wp/?tag=psychotherapy), rather than the full length post. How do I do this? I see the following in the tags.php page for my theme: ...
Doug's user avatar
  • 139
0 votes
2 answers
731 views

Check if excerpt is empty at loop-portfolio

I want to check if excerpt is not empty, then echo the excerpt link, if not the echo permalink, like this: if(the_excerpt()!='') echo the_excerpt(); else echo get_permalink() but how can I check if ...
rakela's user avatar
  • 101
0 votes
0 answers
375 views

is_page_template() doesn't work with excerpt_length filter

I am tring to set a different excerpt lenght for the pages that use an specific page templates using excerpt_length filter. This is the code: add_filter( 'excerpt_length', 'nmd_excerpt_length', 999 );...
ThemesCreator's user avatar
2 votes
2 answers
2k views

Remove whitespace before the_excerpt();

I need to delete the whitespace that the_excerpt(); function returns me. I noticed it gives me whitespace before the whole text only where in the page images goes first and only after goes text. I ...
Driglou's user avatar
  • 25
0 votes
1 answer
1k views

run shortcode in excerpt of single custom post type

Hi because of the way my theme is set up, I need to run a shortcode inside the excerpt of a custom post type (services). This is the code I have so far... function do_my_shortcode_in_excerpt($excerpt) ...
Paul Brown's user avatar
14 votes
6 answers
53k views

Remove more or [...] text from short post

I use a theme that have a character limit for shortpost and show [...] at the end of character limit. I want to remove this, so I search for the_excerpt(); and replace with the_content(); The ...
Arioman's user avatar
  • 153
0 votes
1 answer
202 views

shortcode issue in the_excerpt

I had this custom shortcode working but it seems to have stopped. I had the code running through another shortcode that ran the loop for category posts. I have since improved the code so that it works ...
Jamie's user avatar
  • 1,363
0 votes
1 answer
772 views

Limit article to 100 characters. Can't use the_excerpt...

I've been struggling with this for a long time... I want to limit article lenght to 100 characters and after 100 char. limit, add at the end '...' linked to a single post (like wordpress's <!--more-...
Paul's user avatar
  • 13
2 votes
2 answers
5k views

Empty excerpt using wp_get_recent_posts

I have this simple shortcode to display the last posts with it's title and except: add_shortcode('latest3', function(){ $recent_posts = wp_get_recent_posts( array( '...
Th3Alchemist's user avatar
1 vote
1 answer
1k views

Display oEmbed in the_excerpt

I am currently adding add_filter('the_excerpt', array($wp_embed, 'autoembed'), 9); to my functions.php file to no avail any other suggestions would be great. Also if I add $content-width to ...
user1095118's user avatar
0 votes
1 answer
2k views

How to show an entire post content and not also the excerpt?

I am pretty new in WordPress theme development and I have the following problem showing posts. You can easily understand what I mean opening this link: http://lnx.asper-eritrea.com/25-ottobre-2013-...
AndreaNobili's user avatar
0 votes
2 answers
933 views

Using "excerpt_more" filter for a specific post type

I have used excerpt_more filter in a theme's functions.php and in a plugin's functions.php. Here is the code for the theme function theme_excerpt_more( $more ) { return '...'; } add_filter(...
Alamin's user avatar
  • 162
3 votes
3 answers
31k views

How to get post or page excerpt using post_excerpt

I am using the following foreach loop: $pages = get_pages(array ('post_type' => 'page','sort_column' => 'menu_order',)); foreach ($pages as $page) { $apage = $page->post_name; ...
cmsdeployed's user avatar
-2 votes
1 answer
390 views

Export Posts in excel [closed]

How can i export post only with this data in excel :- Post title - Post URL - Author - publish Date Thanx
khalid ahmed's user avatar
2 votes
1 answer
9k views

wp_trim_words is trimming by character instead of by words

I'm using Wordpress 3.9.2, and having trouble with the wp_trim_words function. It seems to be cutting the string down to X characters instead of X words. Example Put the following in a template ...
Banjer's user avatar
  • 750
0 votes
1 answer
81 views

Excerpt filter is adding '</p>' in incorrect place

I'm using the following code from this question in order to limit the excerpt length to 2 paragraphs. if ( ! function_exists( 'wpse0001_custom_wp_trim_excerpt' ) ) : function ...
SLH's user avatar
  • 1,432
0 votes
0 answers
56 views

Search & Replace trailing strings

I need to filter the_content/the_excerpt and search & replace the following prepared array: $searchArray = array("foo", "bar", "foo bar", ...); My problem is the fact, that using php's ...
flowdee's user avatar
  • 198
0 votes
1 answer
938 views

Adding Read More to Custom excerpts

I've added the following code to my functions.php: function new_excerpt_more($more) { global $post; return '<strong><a class="moretag" href="'. get_permalink($post->ID) . '">......
agilityweb's user avatar
0 votes
2 answers
585 views

I can't seem to get excerpts showing inside get_pages and don't know why?

So, I have a foreach loop within get_pages that shows a list of child pages within a parent ID. The titles, featured image, and links come through fine, however I can't get excerpts to show up at all....
Lee's user avatar
  • 337
0 votes
1 answer
920 views

Why the_excerpt() function returns excerpt on the Home page and trimmed content in sidebar?

I have this code to display 4 posts of type "testimonial" on the Home page: <?php $custom_posts = get_posts([ 'numberposts' => 4, 'post_type' => '...
Macejkou's user avatar
  • 113
0 votes
1 answer
415 views

Return only content in excerpt field in loop

I am sure this has been asked before, but I can't seem to find the answer, although it seems simple enough. I have built a custom theme based on another person's design. He uses both the excerpt and ...
picus's user avatar
  • 101
0 votes
0 answers
54 views

2 posts same excerpt?

I'm facing the following problem: I'm outputting 2 posts with different titles, dates, permalinks but the excerpt are both the same. <?php $query = new WP_Query( array( 'post_type' =&...
rwzdoorn's user avatar
  • 375
0 votes
2 answers
3k views

How to show only the date, the title and a little “summary” of my WordPress post in my custom theme?

I am pretty new in WordPress theme development and I have the following doubt about how show posts into a page. I have this page belonging to an old custom legacy blog that I am build again using ...
AndreaNobili's user avatar
-2 votes
1 answer
3k views

Modify Twenty Fourteen Home Page Content Limit & Add Read More Link

I've install the new Twenty Fourteen theme for WordPress. I don't know how add summary text of posts on my front page. All old tutorials like this does not work with new theme. Any suggestions on ...
user2047800's user avatar
3 votes
1 answer
2k views

Custom wp_trim_words() function not trimming right

I have this custom wp_trim_words() function set to give me excerpts of only 20 words, and for the most part, it works fine. Except for some reason, on posts that contain lists, it outputs way more ...
mcography's user avatar
  • 363
0 votes
1 answer
2k views

get video from content

I have a post with YouTube video in it. The content is inside $content. Currently I am doing the_content() and this displays full content on my page. The page contains the list of all videos. The ...
renathy's user avatar
  • 213
4 votes
3 answers
1k views

Modify youtube video size on one page and show another size on different page

I have to display three videos (custom post type) on my first page. When clicking on the link, the post is displayed and video should be in default width. Can you help to find out how to change width ...
renathy's user avatar
  • 213
0 votes
1 answer
175 views

Show category post with excerpt text

I want to show a post with post title and post content of 400/550 words with a read more link in my category page. I have already done this, but problem is, my post doesn't display the excerpt as it ...
Accore LTD's user avatar
0 votes
3 answers
219 views

Problem with showing featured image

I am using the code below for showing featured image in single post content.It's working fine.But when I call the_excerpt(); in any template it showing featured image with post content.I want it show ...
S.k.joy's user avatar
  • 11
0 votes
1 answer
3k views

Custom post type change excerpt more and excerpt length

I have written a some code to get custom excerpt_length and excerpt_more. The excerpt_length is working for both custom post type and general post. But I don't know why excerpt_more is not working for ...
John Hack's user avatar
0 votes
0 answers
889 views

Custom search results page not showing excerpt

I have a custom content-searchresults.php page. However for some reason its not showing the excerpt, but other amends I make this on this are pulled through so it is using this template. Below is my ...
probablybest's user avatar
0 votes
1 answer
918 views

How to remove excerpt white spaces

This is my code in wordpress archive: mb_substr(get_the_excerpt(), 0, 236); This echos: NGÀY 1: HÀ NỘI – ĐÀ NẴNG Chiều: khởi hành In view code NGÀY 1: HÀ NỘI – ĐÀ NẴNG ...
Hoang An's user avatar
0 votes
1 answer
105 views

Excerpt displays the current page excerpt not one being pulled

Just as the title says this code is not pulling the excerpt from $recent like it should be, instead it is pulling it from the current page. <?php $args = array( 'post_status' => 'pending'); $...
PirateScott's user avatar
0 votes
0 answers
111 views

Excerpt for each post type and for is_front_page

i try to adjust the excerpt for each post type and especially for the front page. function isacustom_excerpt_length($length) { global $post; if (is_front_page() || is_home()){ if ($post->...
meck373's user avatar
  • 101
1 vote
1 answer
3k views

get_the_excerpt() not working in plugin loop

I am new in WordPress plugin development. I am developing a simple WordPress plugin in which get_the_excerpt() not working in the loop. Other tags such as get_the_title(), get_the_permalink() even ...
Babu's user avatar
  • 33
0 votes
1 answer
2k views

Why is get_the_excerpt returning full content

I have my home page set to a static page with a custom page template. Here I want to show posts, but just the excerpts with a "Read more" link. I want to use the more tag, which is a part of wordpress ...
user568021's user avatar
-1 votes
1 answer
2k views

Excerpt all post content Content Same Size without word cutting off

On my category page there are list of 24 posts with title and excerpt content. To display specific lengths of content, I am using substr function. Now the issue is that each post excerpt content are ...
Jack Torris's user avatar
0 votes
1 answer
2k views

Custom excerpt showing first paragraph (with HTML formatting)

Can somebody help me how to show the full first paragraph of the post, including all used tags (no stripping)? My code: function new_excerpt_more() { global $post; return '…</p><div ...
tomexx's user avatar
  • 123
66 votes
3 answers
134k views

Allow HTML in excerpt

Here is my excerpt code. // Generate custom excerpt length function wpbx_excerpt_length($length) { return 300; } add_filter('excerpt_length', 'wpbx_excerpt_length'); How do I allow html like <...
user32447's user avatar
  • 835
0 votes
1 answer
276 views

Trimming breaks up markup

Lets say that I have this text in a field: <p>The first expedition to the red planet has ended in disaster!</p> <p>Your ship has crashed in the surface and all your equipment is ...
Enrique Moreno Tent's user avatar
0 votes
1 answer
41 views

Edit the excerpt before it is shown

I'm looking for a way the edit the excerpt before it get's show on the page. The issue is this: We import data (jobs) for a third party provider and the content is divided in sections with each a ...
Richard's user avatar
  • 173
4 votes
4 answers
14k views

excerpt_length not working

I'm trying to build a theme, I want to control the length of the post excerpts by doing something like this in functions.php: function theme_excerpt_length( $length ) { return 45; } add_filter( '...
bodesam's user avatar
  • 163
0 votes
2 answers
3k views

Spacing within the excerpt

I am trying to find out how I can control how an excerpt is displayed using PHP. How do I get it to render the html spacing within the post instead of just showing one big paragraph.Hope that makes ...
Diane Laidlaw's user avatar
0 votes
1 answer
631 views

The excerpt suffix won't go away

I want to show the post content until the more tag, or if there's no more tag than just first n words. Something really basic, right? Obviously I need to use get_the_excerpt function. But the problem ...
user568021's user avatar
2 votes
1 answer
333 views

Frontend Post Excerpt field mapping

I'm trying to create a form with gravity forms. I need to merge two fields to one Excerpt. I can't give the Excerpt field a merge tag. So I'm trying to use an custom field. My question is now: what ...
Martin's user avatar
  • 21
12 votes
6 answers
9k views

Move excerpt meta box to above content editor

I found a WordPress hook called "edit_form_after_title" to add a text box after the title. How can I use this hook to display the excerpt after the title while creating a new post?
Abouasy's user avatar
  • 289

1
5 6
7
8 9
13