How do i pick the pages in 20-11 header?

Twenty Eleven uses wp_nav_menu() and supports one Primary Menu. If you haven’t defined one, it falls back to wp_page_menu(), which displays all pages. You can create your own custom menu in the admin area under Appearance > Menus. Select that menu to be the Primary Menu in the upper left Theme Locations box and you’re … Read more

Add pagination to this following template

Firstly, you have 2 queries, the second is overriding the first: <?php query_posts($query_string . ‘&pagename=&page_id=’); ?> <?php query_posts(‘posts_per_page=3’); ?> Replace them with a single query: <?php query_posts($query_string . ‘&pagename=&page_id=&posts_per_page=3’); ?> Then modify your query as such: ‘paged’ => ( get_query_var(‘paged’) ? get_query_var(‘paged’) : 1 ) e.g. <?php query_posts($query_string . ‘&pagename=&page_id=&posts_per_page=3&page=”.( get_query_var(“paged’) ? get_query_var(‘paged’) : 1 … Read more

Page load timer?

$starttime is undefined in your footer, so you’re subtracting nothing from endtime. declare global $starttime first and it’ll work. that said, it won’t be a very accurate indicator of rendering time, since most of the work WordPress does happens before you ever reach the template and start your timer. There’s already a built-in timer that … Read more

Pasting this PHP breaks my page. Why?

Make sure you reference the global $wpdb variable first, otherwise PHP doesn’t know what $wpdb is or whether or not it has a get_results() method or a prefix property. So just add global $wpdb; to fix it: <?php global $wpdb; $gallery_ids = $wpdb->get_results( “SELECT gid FROM “.$wpdb->prefix.”ngg_gallery ORDER BY gid ASC”, ARRAY_A); ?>

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