Admin taking a very long time to load

I would do most of my troubleshooting in the Debug Bar plugin along with the Debug Bar extender plugin. This plugin gives you detailed access to everything that is going on behind the scenes. It can also detail memory usage and execution time for each function and database query along with where it was called … Read more

How can I use “getarchives_where” to get monthly archives for static pages?

wp_get_archives already have post_type=”post” by default and to replace it try this: add_filter(‘getarchives_where’,’my_archives_filter’); function my_archives_filter($where_clause) { str_replace( “post_type=”post”” , “post_type=”page”” , $where ); } in sidebar: add_filter(‘getarchives_where’,’my_archives_filter’); wp_get_archives(‘type=yearly’); remove_filter (‘getarchives_where’,’my_archives_filter’);

Excerpt Now Showing on the Post Page

I am guessing a bit but based on your description, you probably only have an index.php file running both of those pages. If you create a single.php file in the theme that (probably) matches what you had in the index.php before you edited it, you should have what you want. WordPress will look in the … Read more

How to create a page and display only the posts with a specific custom field value?

Duplicate your page.php template, name the duplicate page-facebook.php, give it a template name: /* Template Name: My Facebook Meta Key Page */ More information here: http://codex.wordpress.org/Page_Templates To get the right posts with get_posts use something like this: <?php $args = array( ‘post_type’ => ‘post’, ‘meta_query’ => array( array( ‘key’ => ‘facebook’, ‘value’ => ‘yes’, ) … Read more

How to use is_admin in page content?

As @Rarst said, use PHP code inside a post content is bad habit. But you can use another workaround to show a section only for appropriate users. Add the following code into your functions.php file: add_shortcode( ‘if_user_can’, ‘wpse8170_show_content_if_user_can’ ); function wpse8170_show_content_if_user_can( $atts, $content=”” ) { $atts = shortcode_atts( array( ‘capability’ => ‘edit_posts’ ), $atts ); … Read more

How to list a page tree?

wp_list_pages will output all of the pages, posts, and CPTs that you wish. You even have control over the CSS classes, some of which are already there: All list items (li) generated by wp_list_pages() are marked with the class page_item. When wp_list_pages() is called while displaying a Page, the list item for that Page is … Read more

How to edit a HTML list in WordPress?

Content in a page can come there in four ways in WordPress: In-page Content: That’s coming from the WordPress’ site’s page content itself. In this case you have to edit the page in your /wp-admin. Page Template: That’s coming from a page template. In this case, you have to get into your theme folder to … Read more

Redirect page to default subpage

You can try something like this. This will check if a page has child pages and if it does then it will redirect the first page in array ordered by menu order. // get child pages $child_page = get_pages( “child_of=” . $post->ID . “&sort_column=menu_order” ); if ( $child_page ) { // get id of first … Read more