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

One approach is: //… // this is the resulted paragraph without the enclosing <p> and </p> $first_para_inner_text = $matches [1] [1]; // <– the index changed $link = get_permalink($post); // rebuilding the p $first_para=”<p>” . $first_para_inner_text . ‘ <a href=”‘.$link.'”>Read More</a></p>’; echo $first_para; Not tested, but you may get the idea. Just need to modify/change … Read more

Truncating varying lengths of information

I know toscho doesn’t like this very much, but anyway: Converted the input args to an array: function utf8_truncate( $args = array( ‘string’ => null, ‘max_chars’ => 200, ‘append’ => “\xC2\xA0…” ) ) { $args[‘string’] = strip_tags( $args[‘string’] ); $args[‘string’] = html_entity_decode( $args[‘string’], ENT_QUOTES, ‘utf-8’ ); // \xC2\xA0 is the no-break space $args[‘string’] = trim( … Read more

Displaying latest Posts – fixed height – Excerpt vs. Content?

The simple way to do this is to define the height/width in CSS of a container, and then apply a trim on the excerpt. To change default excerpt length add this to you functions.php function new_excerpt_length($length) { return 100; // change this to how many any characters you want } add_filter(‘excerpt_length’, ‘new_excerpt_length’); Manually controlling the … Read more

How to make the excerpt_more filter apply to the actual post excerpt?

I’m going to assume that you’re calling get_blog_excerpt() in your template somewhere? If so, what happens if you simply call the_excerpt(), and then pull the two add_filter() calls out of the container function? i.e. functions.php would just look like: function ce4_excerpt_length($length) { return 150; } add_filter(‘excerpt_length’, ‘ce4_excerpt_length’); function ce4_excerpt_more($more) { global $post; return ‘…<a href=”‘. … Read more

Excerpts automatically remove paragraph space

Looks like my other answer wasn’t working, so I looked into it and found this: http://aaronrussell.co.uk/legacy/improving-wordpress-the_excerpt/ That article should give you all you need to keep the <p> tags in there.

Disabling automatic teasers

Try using $post->post_excerpt instead: // globalize $post, just in case global $post; // find out if the post has a defined excerpt $data = $post->post_excerpt; // If so, output something if ($data) echo “<div class=”excerpt”>$data</div>”; This method will bypass the auto-excerpt generation inherent in get_the_excerpt(). EDIT By popular demand, the same code, using has_excerpt(): // … Read more

Show Sub pages excerpt+thumbnail

I recently wrote code that I just put into a new page template that does exactly this. The all you do is assign the parent pages that specific template (or any page you wish to have this functionality on) and then it’ll list it’s child pages with their featured images as thumbs. Getting a plugin … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)