Questions tagged [excerpt]

Excerpts are short texts or summaries

Filter by
Sorted by
Tagged with
0 votes
0 answers
15 views

How to share to Facebook as an excerpt?

Doesn't have to be automated. It's just every instruction I read says to just paste a link and wait a fee seconds. For me it doesn't work. It always shows the main page image, instead that of an ...
Warxuaroz's user avatar
  • 101
0 votes
1 answer
54 views

Only show read more text when when wp:post-excerpt meets excerptLength

NOTE: The issue I'm encountering is specific to Block Themes; I understand how to filter the text returned from the_excerpt in a Classic Theme. What I would like to only show read more text when when ...
JDQ's user avatar
  • 149
0 votes
1 answer
34 views

Fix count of lines of excerpt block (or any block)

I have a need for the Power Query's nested excerpt block to be a fixed height, which means it is 2 lines tall, whether the excerpt text is 1 line or 3 lines. Is it possible to fix a block's height? I ...
how-mustard-tastes's user avatar
0 votes
2 answers
92 views

Display Rank Math Meta description at the beginning of single post

With this code register_activation_hook( __FILE__, 'rm_to_excerpt' ); function rm_to_excerpt() { $args = array( 'post_type' => 'post' , 'numberposts' => -1 ); $...
Solo Solo's user avatar
0 votes
1 answer
40 views

hook on the_excerpt

I would like to have the excerpt length formatted + [...] and then keeping the 'read-more' as a button. I was able to hook the 'excerpt_length' from 55 to 25 and that was fine: function ...
made leod's user avatar
0 votes
0 answers
17 views

Excerpt selected content automatically

Hi, as you know, the excerpts will show only a part of the content which always starts at the beginning of the post and ends wherever the character limit is set to. However, I want to show a part of ...
Cain Nuke's user avatar
  • 163
0 votes
1 answer
26 views

Strip and print only the numbers found in current's post excerpt (even if they are without space)

I have a working code for printing just the year (number) if found in the current post excerpt, but the problem arises when the number (a year) is followed by a Japanese character (example: '2023年', ...
vyperlook's user avatar
  • 177
0 votes
1 answer
42 views

I have issue with decoding json ex. '{"a":"b"}'

Hey I am trying to send JSON data from (WRITE AN EXCERPT (OPTIONAL)) this section. Let say I pass this '{"a":"b"}' as Map now in the wordpress templete I tried to get this so I was ...
waqas023's user avatar
0 votes
1 answer
444 views

HTML in excerpt Wordpress 6.2.2

A while back (5+ years) I was asked to build a site where there was some HTML needed in the WP excerpt, from what I can remember I achived this by overriding "get_the_excerpt" something like ...
Tbreak's user avatar
  • 1
0 votes
1 answer
171 views

How to fix special characters when the title or excerpt is shortened [closed]

I have this code for the title <?php $thetitle = $post->post_title; $getlength = strlen($thetitle); $thelength = 26; echo substr($thetitle, 0, $thelength); if ($getlength > $thelength) echo &...
unopermanente's user avatar
0 votes
0 answers
29 views

Format main page post excerpt previews

For my posts, I use a block quote/pull quote at the top of them all to highlight a key sentence that is contained in the body of the post. The only problem is the post excerpts also pull this line in ...
user2080994's user avatar
0 votes
0 answers
17 views

Setting post excerpt length in php wordpress code, Should will help to save DB size?

I am trying to optimize wordpress DB. As Google or any other search engine only reads around 300 char of data per blog, It's better to set excerpt length to 300 char. but doing this do we save DB ...
Anand Somani's user avatar
0 votes
1 answer
159 views

Remove automatic excerpts only for single posts

I want to be able to remove automatic excerpts (and keep the custom ones) only on single posts since I make use of automatic excerpts in my archives. I am using this code: if ( is_single() && '...
quantum_leap's user avatar
0 votes
1 answer
514 views

Ignoring <a> links from the_excerpt

I am looking for a way to ignore any <a> links in the content WP displays in the the_excerpt - is there a way I can achieve this? The excerpt is not actually used on the WP page itself, so the ...
Jdubbs's user avatar
  • 3
0 votes
1 answer
42 views

code block does not show in excerpt

I am creating some blog pages with example codes, and I would like to show the codes in excerpts, but WordPress automatically excludes code blocks from excerpts, is there a workaround for showing code ...
Botond Vajna's user avatar
0 votes
1 answer
1k views

How to Remove HTML Elements from Post Excerpt?

I am Using the Following Code and want to remove HTML All Elements. <?php $exerpttext = substr(get_post_field('post_content', $post->ID), 0, 300); if (!empty($exerpttext)) { echo $exerpttext.'......
stepiadm's user avatar
1 vote
1 answer
186 views

How to put "Read more" link in Custom Excerpt inside p tag?

I have a piece of code that extracts the first paragraph from the post, enclosed in a p tag. I want to add a "Read more" link inside the p tag referring to "the full post". Please ...
Juniper Scott's user avatar
0 votes
0 answers
110 views

How to add text before post_excerpt in Gutenberg

I'm trying to edit my plugin to work on the updated version of the website. I have a custom plugin, which worked with plugin Post in Page but not working with the integrated function of Gutenberg - ...
ShippeR's user avatar
0 votes
0 answers
110 views

“Continue reading” not on some posts, full excerpts not shown

Crossposted from my topic on wordpress.org forum since I don't seem to be getting any bites Hi there! I’m fairly new to WordPress, my website is https://slasheethecow.com and I’m trying to be a ...
Slashee the Cow's user avatar
0 votes
1 answer
410 views

Automatic excerpt is not shown with the_excerpt() command

I've been looking for an answer to this question for a long time, but haven't found anything: how come when I use the_excerpt() on a given site it doesn't automatically print the first few characters ...
Matteo Feduzi's user avatar
0 votes
1 answer
596 views

adding class to excerpt

I want to add different classes to some excerpts.when wrap the excerpt with it doesn't work.how can I add my class to excerpt? <?php <p class="myclass"><?php the_excerpt(); ?>...
attack-to-overflow's user avatar
0 votes
1 answer
166 views

How to enable excerpts just on the "Posts page"

In my fresh WordPress installation I'm using a barebones child theme based on the twentyseventeen theme. In Settings > Reading, "Your homepage displays" is set to the radio button "A ...
nev's user avatar
  • 1
0 votes
1 answer
183 views

Wordpress Excerpt - How to remove the first link using functions.php

I've just imported a blog into Wordpress and all of the content begins with: <a href="itunes.com">Listen on iTunes</a> followed by the paragraph content, so all excerpts appear ...
Dave's user avatar
  • 1
0 votes
1 answer
672 views

Change label text in Gutenberg's built in excerpt panel

The excerpt panel in the Gutenberg block editor has the label text "Write an excerpt (optional)" How can this text be edited? Specifically I want to remove "(optional)". I've ...
anu's user avatar
  • 9,552
0 votes
0 answers
56 views

why does an empty get_the_excerpt change get_the_ID to default homepage?

Using a post-carousel plugin, the following error is occurring after one line of code executes (the get_the_excerpt command only): If the_excerpt for the current $post is empty, this is the result: ...
user3810531's user avatar
1 vote
1 answer
486 views

Why is Wordpress showing a blank excerpt for just one of my posts?

For most of the posts on my Wordpress site, I leave the manual excerpt box empty & let Wordpress generate the excerpt based on the content of my post. Until now, this has been working fine — I ...
TAH's user avatar
  • 235
0 votes
1 answer
62 views

restrain filter on get_the_excerpt to queried item in stead of current post

So, I have a walker nav menu who add the page excerpt to all page links in the nav menu. Now, I want to build a custom post excerpt for the blog archive. All works fine when the nav menu doesn't meet ...
quasi's user avatar
  • 101
1 vote
1 answer
221 views

Shortcode To Display Post Custom Field Value Inside Excerpt

I want to create a shortcode that pulls value from a custom field of a post and returns that value inside excerpt. I already have a function for the custom value: function geo_name_function( $atts ) { ...
Discover's user avatar
0 votes
1 answer
127 views

Setting a default text for excerpts of a particular category

I am extremely new to WordPress Development and PHP in general, and was wondering if there is a way to create a function that would automatically add some pre-determined text to the excerpt of posts ...
Alfred Sant's user avatar
1 vote
0 answers
228 views

Allow HTML in Excerpts in Elementor

Is there any way to display formatted text from Elementor in the excerpts. If it's not possible, it would be great when the formatted excerpts with activated Elementor plugin would be displayed. I ...
Matthias's user avatar
0 votes
1 answer
123 views

Show metabox value last post excerpt, title and link

I'm facing a problem I can't solve. I'd like to get the excerpt, title and link of the last post containing a particular meta-box button status. For example: I would like to retrieve the last post ...
Sagaroth's user avatar
1 vote
0 answers
78 views

Error when adding excerpt to the content through functions.php

I am trying to add the excerpt from a specific post to the content. function add_2_the_content( $content ) { if (is_front_page()){ $custom_content = get_the_excerpt('some_id_number'); } $...
Leadhood's user avatar
0 votes
1 answer
56 views

Filter Post Title without affecting screen-reader-text

Let's consider this code: add_filter('the_title', static function ($title) { return $title. '-boom'; }); Works fine, and adds '-boom' near all the titles. But, I also noticed that in some themes (...
Dudo1985's user avatar
  • 223
1 vote
1 answer
96 views

How to display excerpt post on hamepage and archive pages?

I am showing full posts on my blog's homepage and also in archive pages but the problem is, Now i have posted some long post and i want to show there only excerpt with read more button on hamepage and ...
Emma's user avatar
  • 11
0 votes
0 answers
110 views

How to make force_balance_tags balance comment tag

I'm displaying a preview of a post/page/cpt using a 'work-around' that i found. This 'work-around' gets the post content, trim it and render the trimmed content with it's html elements ( links, images ...
Mat.C's user avatar
  • 111
0 votes
0 answers
19 views

Related post not showing table of content

I have squaretype themes and this themes use built in table of content. My question is how to change related post to show excerpt not table of content words?
Ary Bagus Octora's user avatar
0 votes
0 answers
522 views

shortcode doesnt work on excerpt

My shortcodes don't seem on archive page excerpts. You can see an example excerpt: https://unit-test-data.deniz-tasarim.site/2011/03/15/ here is related code with an excerpt in my theme files: ...
Faruk rıza's user avatar
0 votes
1 answer
1k views

Get the automatic excerpt from a page created with gutenberg

The problem I have is im not getting the automatic excerpt (the_excerpt()) when I create a post with gutenberg blocks, If I put an image or something before the text it looks like gutenberg does not ...
kelvin ramirez's user avatar
2 votes
1 answer
2k views

How to get excerpt correctly formatted

I'm using a theme that use the_excerpt() function to show the excerpt of the post. All posts have not set custom excerpt, so the_excerpt() returns a piece of post content. In some post first paragraph ...
Lety's user avatar
  • 131
0 votes
1 answer
96 views

Empty the_excerpt() broke the_permalink() under him?

I have a problem. It is <?php the_excerpt(); ?> empty from gutemberg <?php the_excerpt(); ?> pull little part of content from post but first next <?php the_permalink(); ?> under is ...
Milosh N.'s user avatar
  • 205
2 votes
1 answer
2k views

How to display links in excerpt? [duplicate]

I am not able to see how to display links within excerpts. A number of posts suggest to try something along the following lines, but I am not able to render links within excerpts. What do I miss? ...
mario's user avatar
  • 121
0 votes
1 answer
423 views

How to limit wordpress the_excerpt() dynamically

I'm trying to limit WordPress post excerpt and I've tried some ways to do it but all of them was not the stuff that I need, to say concisely I want to limit post excerpt with a number that I use ...
irgfx's user avatar
  • 101
0 votes
1 answer
329 views

Default excerpt for parent of a custom post type

I've created a hierarchical post type called mycustomposttype. Parents are created in the backend, children via gravityforms. Due to my theme setup, I would like all parents in mycustomposttype to ...
dkrahl's user avatar
  • 1
-1 votes
1 answer
257 views

Excerpt – First Sentence & Read More

I am using this function to limit the excerpt to the first sentence... function hello_first_sentence( $string ) { $sentence = preg_split( '/(\.|!|\?)\s/', $string, 2, PREG_SPLIT_DELIM_CAPTURE ); ...
PauloP's user avatar
  • 51
0 votes
2 answers
538 views

has_excerpt() not working inside wp_query

I am trying to check for an excerpt and if it doesn't exist then show the content but trimmed. Currently nothing is showing. <?php if (has_excerpt() ): ?> <p><?php echo ...
Iggy's Pop's user avatar
0 votes
1 answer
2k views

Hook for changing excerpt content when excerpt not set

Title says pretty much all of it. I need a filter that I can use to change excerpt content for those posts that have no excerpt set. Now, I've tried both the_excerpt and get_the_excerpt, they both ...
errorous's user avatar
  • 169
0 votes
0 answers
38 views

Read More excerpt link on a post is not linking to the post itself

My Read More link on several pages (showing an excerpt of those posts) is not linking to the posts themselves when you click on Read More. It looks like it is a link and should do so, but it just ...
Holly's user avatar
  • 1
0 votes
1 answer
2k views

WPBakery Page Builder Shortcode Showing On Front Page For Post

I am working on a new site and am having an issue with the WPBakery plugin. I assume its a custom version of WPBakery, since it's marked WPBakery Page Builder by VisualModo, which is who my theme is ...
Chris's user avatar
  • 1
0 votes
0 answers
55 views

Find and print first <li> entry from Wordpress post in custom excerpt?

I want to create a custom excerpt for an education website. It has posts that contains and listing. I want to print the first child of ul and a first child of ol tag from the post. Currently, I ...
Juniper Scott's user avatar
0 votes
1 answer
1k views

Custom CSS for full post vs. excerpt (Content Options)

Is there a way activate "Full Post" via Custom CSS or any other way? Right now I am stuck with Excerpts on the Homepage and my Theme Customizer > is missing Content Options Here below is what my ...
KarmicP's user avatar

1
2 3 4 5
13