Add a new page to wordpress programmatically
Yes, it’s wp_insert_post().
Yes, it’s wp_insert_post().
That’s pretty advanced and it doesn’t sound like you are all that comfortable with WP yet, no offense. You can definitely do this with WP Alchemy (I have and do), but you really have to get down and dirty with some Javascript to 1. launch the media uploader and 2. to hijack the send to … Read more
You can’t change dashes using any filter because there is no filter available to change it. but still you can change this using jQuery put this code inside functions.php add_action(‘admin_head’,function(){ global $pagenow; // check current page. if( $pagenow == ‘edit.php’ ){ ?> <script> jQuery(function($){ var post_title = $(‘.wp-list-table’).find(‘a.row-title’); $.each(post_title,function(index,em){ var text = $(em).html(); // Replace … Read more
You’ll need to do some .htaccess-fu to get what you’re proposing to work. RewriteCond $1 ^/labs/(.+) RewriteRule ^/labs/(.*)$ /labs-folder/$1 [L] This isn’t tested yet but it if you put it before the wordpress rules in your htaccess file it will remap urls that begin with /labs/ to /labs-folder/ but not if the url is just … Read more
Start with downloading the plugin called Force Post Title. Here’s the plugin with one row (2 with the comment line) added to the bottom, based on our comments. What happens is that a small jQuery script is added to the page Create Post/Page. The script will check if the title field is empty when the … Read more
There are some issues in WP permalinks implementation that introduce scaling issues for large amount of pages and some specific permalink configurations, see Category in Permalinks Considered Harmful. Other than that it is business as usual – use decent hosting, keep plugins setup efficient, add caching and you will be fine.
I’m fairly certain the problem is that some template tags rely on the global $post variable. Using setup_postdata() as you are now, will not alter $post. If you replace all the instances of $pageChild with $post, everything should work. However, I would strongly recommend using the WP_Query class and setting up your post data with … Read more
It should look like this: <?php $pages = get_pages( array(‘sort_column’ => ‘menu_order’) ); ?>
Use ‘orderby’ => ‘title menu_order’ or &orderby=title menu_order (depending of the syntax you use for your query parameters).
Just hook the default delete_post handler for menus onto the trash action too: add_action( ‘wp_trash_post’, ‘_wp_delete_post_menu_item’ ); How simple is that!