Way to create pages quickly
Direct injection in to the DB. Have a look at the codex for $wpdb. I’d suggest putting a line of code in to a for() loop so that you can run it as many times as you want. <?php $wpdb->insert( $table, $data, $format ); ?>
Direct injection in to the DB. Have a look at the codex for $wpdb. I’d suggest putting a line of code in to a for() loop so that you can run it as many times as you want. <?php $wpdb->insert( $table, $data, $format ); ?>
Yes, but you need to use a custom walker. You must modify the function that traverse the page and output the HTML. Extend the basic wordpress class and implement your function. See this stackechange post for a code example. Note: I suggest you to use wp_nav_menu (custom menus) instead of wp_list_page and use the item … Read more
[Update] Answer rewritten, based on this other Q&A. To achieve this: Use this code: add_filter( ‘custom_menu_order’, ‘wpse_48933_submenu_order’ ); function wpse_48933_submenu_order( $menu_ord ) { global $submenu; // Enable the next line to inspect the $submenu values // echo ‘<pre>’.print_r($submenu,true).'</pre>’; $arr = array(); $arr[] = $submenu[‘edit.php?post_type=page’][10]; $arr[] = $submenu[‘edit.php?post_type=page’][5]; $submenu[‘edit.php?post_type=page’] = $arr; return $menu_ord; }
I think the best, most WordPress friendly solution is to use the default template hierarchy. If you’re using a custom post type and default categories, you first need to get the post type into the category (and tag) archive pages. This support thread does that. Now, you can see the portfolio items at yoursite.com/category/web-design, where … Read more
The quick and dirty way is set the published date a year or so in the past, past the oldest posts in the feed. There’s also a nice plugin for this – Stealth Publish – where you set a flag in a custom field to exclude it from feeds and the home page feed.
Add this code in sidebar.php.this code will help you. global $post; $parent_id = $post->post_parent; if(!empty($parent_id)){ $parent_post=get_post($parent_id); echo ‘<h1 class=”entry-title”>’.$parent_post->post_title.'</h1>’; echo ‘<ul>’; $children = wp_list_pages(‘title_li=&child_of=” . $parent_id . “&echo=0’); if ($children) { echo $children; echo ‘</ul>’; } } else { echo ‘<ul>’; $page =$post->ID; $children = wp_list_pages(‘title_li=&child_of=” . $page . “&echo=0’); if ($children) { echo $children; … Read more
This would have to be fully coded and tested, but I think the roadmap is: Deregister the Default Meta Box and Make a Custom One @MikeSchinkel answer to this question is very detailed and thoughtful: Adding Page Attributes Metabox and Page Templates to the Posts Edit Page? In that case, it is for duplicating the … Read more
I’m really not sure where your logic is failing and haven’t revised each one of your insert/delete hooks. But the code can be greatly simplified to only call each function once, thus making it easy to make it work. add_action( ‘wpmu_new_blog’, ‘setup_blog_wpse_114119’, 10, 2 ); function setup_blog_wpse_114119( $blog_id, $user_id ) { create_pages_wpse_114119( $blog_id, $user_id ); … Read more
Create WordPress template with name College & Corporate respectively. Then add some code in your header.php. Refer is_page_template(). With this method WordPress will identify which template you are using and will apply CSS related to it. You can use Default template for rest of the pages.
Well, not quite sure if I understood this, but I see that you want to ‘simulate’ pages using a plugin, and my best bet is to build your own posts on-the-fly using WordPress queries and rewrite rules. Let’s try this: Create a variable to respond to your view. add_action( ‘query_vars’, ‘add_query_vars’ ); function add_query_vars( $vars … Read more