How to show content for posts of a specific category only

You can use the in_category function to test if the current post in the loop is in the specific category you want to display full content for. For example if ( in_category( ‘my_category’) ) : the_content(); else : the_excerpt(); endif; For more information on the in_category function see the WordPress codex at: http://codex.wordpress.org/Function_Reference/in_category

Archive limit the text of the_content

I’m assuming ‘Archive Page’ is a custom template and not either of the WP archive pages (category/date/author/tag/taxonomy). Try using this: <?php add_filter(‘the_content’, ‘trim_content’); function trim_content($content) { if(is_archive()) { //use your own trick to get the first 50 words. I’m getting the first 100 characters just to show an example. $content = (strlen($content) <= 100)? $content … Read more

Grab value of excerpt_length

You could store the length like this. function store_excerpt_length($length) { update_option( ‘excerpt_length’, $length ); return $length; } add_filter( ‘excerpt_length’, ‘store_excerpt_length’, 1000 ); Then use the following code to get the length. echo get_option( ‘excerpt_length’ );

Handling embedded videos in excerpts

Try this: global $wp_embed; if ( get_option(’embed_autourls’) ) remove_filter(‘the_content’,array(&$wp_embed,’autoembed’)); // do excerpt/content stuff if ( get_option(’embed_autourls’) ) add_filter( ‘the_content’, array(&$wp_embed, ‘autoembed’), 8 );

Shortcode not displaying video as expected

Had a bit of a brain wave and thought I would capture the output and return it in the function. Turns out it fixed the problem so the final code ended up looking like this: function amazon_video($atts){ extract( shortcode_atts( array( ‘file’ => $file ), $atts ) ); $url = get_bloginfo(‘url’); $return = “<embed src=””.$url.”/jwplayer/player.swf” name=”player” … Read more

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