Fixed height of the_content()

If you run a wp_kses() on the_excerpt() (through a filter) you can whitelist specific HTML tags and such. In your case, the code would probably look something like this: if( is_page( ‘your_page’ ) ) { add_filter( ‘the_excerpt’, ‘wpse44363_filter_the_excerpt’ ); } function wpse44363_filter_the_excerpt( $excerpt ) { // this allows no html, you can allow only links … Read more

Limit Loop to One Category

There is no category argument for query_posts, a category ID should be passed via cat. However, if this is an additional query, please use WP_Query rather than query_posts. If this is the main query, please see pre_get_posts to alter the main query parameters. For more info please see When to use WP_query(), query_posts() and pre_get_posts.

How can I set a maximum allowed post size and number of posts submitted?

The best way I know of would be to filter the data. For posts, you might do: function my_check_post_not_crazy( $data, $post_arr ) { $max_content_length = 2048; # max length in characters $max_num_posts = 200; # maximum number of posts if ( !current_user_can(‘activate_plugins’) && empty( $post_arr[‘ID’] ) ) { $die_args = array(‘back_link’ => true); # Not … Read more

How to limit page pagination… again

I was lucky, the theme used it’s own function, so it was easy to override. Inspired by worpdress native get_the_posts_navigation (wp-includes/link-template.php) here is what I end up using: function my_get_the_posts_navigation( $args = array() ) { $limit = 5; $navigation = ”; // Don’t print empty markup if there’s only one page. if ( $GLOBALS[‘wp_query’]->max_num_pages > … Read more

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