Ok folks, this will be short. If you want to add several pages at once, I created a little script for you.
<?php include ('wp-blog-header.php'); $newPages = array( 'Page 1' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 'Page 2' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 'Page 3' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 'Page 4' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.' ); foreach($newPages as $pagename => $content) : $postarr = array( 'post_title' => $pagename, 'post_content' => $content, 'post_status' => 'publish', // can be changed to 'draft', 'publish', 'pending', or 'future' 'post_author' => 1, // post author 1 is admin, can be changed to the ID of the post author 'post_type' => 'page', // can also use 'post' here. // 'post_parent' => '22', // (completely optional) you can assign a parent ID to create child pages. ); wp_insert_post($postarr); ?> <p>Added <?php echo $pagename?>.</p> <?php endforeach; ?>
That’s it, your new pages have been added. Be very careful not to reload the page, or navigate to this page again, or it will duplicate the pages, which can be quite frustrating to straighten out. But that’s it. It really is that easy. You can also see my comments in blue.
I might make a plugin that you can drop into a site to enable users to frame out a site with the pages needed and whatnot. Maybe I’ll make that my next project, anyway, hopefully you found it useful, if you’d like to download the php file, you can get it below:
Put this file in your root directory (so like: http://geekoutwith.me/insertposts.php). If you put it somewhere else, you’ll have to change the path of the include for wp-blog-header.php
Below is a quick video tutorial of using Mac OS’ built-in color picker to create color palletes for use in your CSS documents.
I was recently working on a project and came up with a decently automated solution for creating grunge torn edges in photoshop…and here it is:
I was working on an email blast for a client when I remembered how effective the defringe tool is, and though I don’t explain it too thoroughly in this screencast, it might be helpful for you.
I wanted my website to be a little easier to read in the iPhone. I knew there was a new CSS3 property called Media Queries. This allows you to discriminate based on window size. So, in the header, as I would normally pull in a stylesheet, I can say: And that will pull in a stylesheet for the iPhone, mine look…
I wrote the third part of the embeddable mp3 players series over at buildinternet.com. Those guys graciously allowed me to geek out on their blog. Since they get way more traffic than I do, I think more people will find it useful. You can see how they make me look good here: http://buildinternet.com/2…
The theme GeekOut, which as of this moment I am using on this site and may release once I decide to go in a different direction with the design, uses jQuery to accomplish a number of things. 1. The animations that are featured both in the navigation and the social media icons I’m using the jQuery an…
I was working on my daughter’s blog, which might be the most robust blog I’ve built, because it is my testing grounds for new features to add to WordPress sites/blogs. Tonight I added a neat kind of functionality, something I’d like to share. Shortcode to show thumbnails. Here…
We have a sort of tradition in my little family. Every Saturday we get up and make breakfast together. Sometimes we make Eggs, Bacon, biscuits and hash browns, other mornings we have waffles or pancakes. It’s always a fun way to start the day together. The next thing we do is something productiv…
{2}