put the content of a single post into og:description

get_the_content() must be inside the loop, in header.php you can do this (don’t forget to scape the content to use it as attribute): if (is_single()) { while (have_posts()) { the_post(); $content = get_the_content(); $desc=”<meta property=”og:description” content=””. esc_attr($content) .'”>’; echo $desc; } } or even better, in your functions.php hook the wp_head action; also, I recomend … Read more

Proper use of the_content filtering

You want to add a filter to the filter queue on the_content: add_filter(‘the_content’, ‘anything’); WordPress core then calls apply_filters within the_content function to run all filters in the queue: function the_content( $more_link_text = null, $strip_teaser = false) { $content = get_the_content( $more_link_text, $strip_teaser ); $content = apply_filters( ‘the_content’, $content ); $content = str_replace( ‘]]>’, ‘]]&gt;’, … Read more

Add span to the first letter of post

This drop caps plugin does what you are looking for: http://wordpress.org/extend/plugins/drop-caps/ If you’re trying to do drop caps this should be enough. If you want to do more you could look into the code and see how the plugin wraps the 1st char in a span. It probably uses preg replace too. Id look myself … Read more

Template Page Content Made Searchable

By default WordPress cannot search in template content. You should import your content into the data base. The plugin HTML Import 2 will help here. Another option is a separate search engine with a parser that can read the complete HTML output. The plugin Search Unleashed for example supports Apache Lucene. That’s probably too much … 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

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