How to display only an excerpt of the content with custom post types?

You only need two small changes (1st and 3rd lines), though I also took the liberty of tweaking the classes on the div to what seemed more appropriate: <h1 class=”title”><a href=”https://wordpress.stackexchange.com/questions/67750/<?php the_permalink(); ?>”><?php the_title(); ?></a></h1> <div class=”excerpt event”> <?php the_excerpt(); ?> <?php wp_link_pages(array(‘before’ => ‘<div class=”page-link”>’.__(‘Pages’, ‘cpotheme’).’:’, ‘after’ => ‘</div>’)); ?> </div>

How to display links in excerpt? [duplicate]

First, I would suggest that you combine your p and a tags into one line, like so: $text = strip_tags($text, ‘<p><a>’); Second, the remove_filter and add_filter should go in your functions.php file, not content.php…..move those lines to just below the $text = strip_tags….. I don’t think you need the line that has $main_content = apply_filters … Read more

How to correctly limit the content and strip HTML?

First, I wouldn’t modify the string/word length of the content. Semantically, you’re dealing with an excerpt, so let’s focus on that. Second, to limit the number of words returned for the excerpt, simply filter excerpt_length: <?php function wpse52673_filter_excerpt_length( $length ) { // Return (integer) value for // word-length of excerpt return 150; } add_filter( ‘excerpt_length’, … Read more

First letter cutting off in excerpt

I’m going to give you a hard-coded solution to this problem, rather than using a plugin. If you’re heart is set on a plugin that is fine – but this short code is rather simple and hopefully helpful for your purposes. This code is basically just adding a CSS class to a shortcode. First, deactivate … Read more

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