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

The twentyfourteen index page calls get_template_part( ‘content’, get_post_format() ); inside the loop. So the content of the loop resides in template files with the name content-{$post_format}.php. All posts that does not have a post format uses content.php to display the post data If you look at content.php, these lines are where the content is retrieved … Read more

Spacing within the excerpt

The excerpt stips all html tags, a feature that frustrates many. I have written a custom excerpt that stops the excerpt from stipping any html tags. It also breaks the excerpt after the sentence after the set amount of words. If you need to cut the excerpt at exact words, you will just need to … Read more

Stripping shortcode from custom excerpt function

Don’t use a custom function. You should use the hooks. You don’t have to strip shortcodes, wordpress does that for you automatically, just use something like this // setting higher priority so that wordpress default filter have already applied add_filter(‘the_excerpt’, ‘custom_excerpt_filter’, 11); function custom_excerpt_filter($excerpt) { // apply your logic of read more link here return … Read more

Excerpts that don’t truncate words

Set the filter dynamically based on the page you are loading. If category archive pages have a 100 word excerpt, but posts have a 10 word excerpt, and everything else uses the default: function my_custom_excerpt_length( $orig ) { if( is_category() ) { return 100; } elseif( is_single() ) { return 10; } return $orig; } … Read more

Cannot strip JW Player shortcode?

JW Player Plugin for WordPress does not register its shortcode like all other shortcodes, so strip_shortcodes() will not know about it and not strip it. In the code there is a note that this is because it uses argument names with a . in it, and WordPress does not support this. There are probably multiple … Read more

When is wp_trim_excerpt() called?

If you’ve already looked in XRef, you’ve seen this comment at the top of the doc block: /** * Generates an excerpt from the content, if needed. So it’s not used in core, but is available for you to use if you need it. Update Let me explain a little of what’s going on: excerpt_length … Read more

Shortcode content does not show in feed discription/excerpt

Ok I had to write my own custom excerpt like such: function custom_excerpt($text=””) { $raw_excerpt = $text; if ( ” == $text ) { $text = get_the_content(”); // $text = strip_shortcodes( $text ); $text = do_shortcode( $text ); $text = apply_filters(‘the_content’, $text); $text = str_replace(‘]]>’, ‘]]>’, $text); $excerpt_length = apply_filters(‘excerpt_length’, 200); $excerpt_more = apply_filters(‘excerpt_more’, ‘ … Read more

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