930 WordPress All in One For Dummies


4 months ago
Full text

  Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions . Trademarks: Wiley, the Wiley Publishing logo, For Dummies, the Dummies Man logo, A Reference for theRest of Us!, The Dummies Way, Dummies Daily, The Fun and Easy Way, Dummies.com, Making Everything Easier, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc.


  Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions . Trademarks: Wiley, the Wiley Publishing logo, For Dummies, the Dummies Man logo, A Reference for theRest of Us!, The Dummies Way, Dummies Daily, The Fun and Easy Way, Dummies.com, Making Everything Easier, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc.


  Cory Miller: I would like to dedicate my part of the book to my family — my mom, Charleen, and my dad, David, who loved and supported me and simply encouraged me that I could do anything I set my mind to do, and my grand-father and fellow entrepreneur, Leo Chaney, who inspired me to live my dreams and to use business as a tool to provide a great, fulfi lling life for myfamily and team. Foolish Assumptions We make some inescapable assumptions about you and your knowledge, including the following:✦ You’re comfortable using a computer, mouse, and keyboard.✦ You have a good understanding of how to access the Internet, use e-mail, and use a Web browser to access Web pages.

2 Conventions Used in This Book

  Book III: Exploring the WordPress Dashboard This book takes you on a guided tour of the WordPress Dashboard, from logging in to the tools and features you use on a regular basis to admin-ister your site. If you are ready to really dig in and get your hands dirty, this book gives you the details needed to tweak the look of existing themes, as well as a compre-hensive look into the structure of a WordPress theme, including the informa- tion and tools you need to create your own theme from scratch.

Chapter 1: Exploring Basic WordPress Concepts In This Chapter

  WordPress is uniquein that it offers a variety of ways to run your Web site — WordPress is not only a blogging platform, but also a full-featured content managementsystem (CMS) that includes all the tools and features you need to publish a blog or a complete Web site on your own, without a whole lot of technicalexpertise or understanding. Content, as it applies to the data that’s stored in the MySQL database, refers to your blog posts, comments, and options that you set up on the WordPress Dashboard, or the control/administration panel of the WordPress software where you manage your site settings and content (Book III, Chapters 1 and 2).

20 Using WordPress as a Content Management System

  This full site includes astatic front page of information that acts as a portal to the rest of the site, on which you can find a blog, a portfolio of work, a contact form, an order form,and various other static pages, including Services, FAQ (Frequently AskedQuestions), Terms of Service, Privacy Policy and more. Using WordPress as a CMS means that you’re creating more than just a blog; you’re creating an entire Web site full of sections and features that offer adifferent experience for your visitors.

Chapter 2: Exploring the World of Open Source Software In This Chapter

  WordPress software users need a basic understanding of the open source concept and the licensing upon which WordPress is built becauseWordPress’s open source policies affect you as a user — and greatly affect you if you plan to develop plugins or themes for the WordPress platforms. You also discover how theGPL license applies to any projects you may release (if you are a developer of plugins or themes) that depend on the WordPress software and howyou can avoid potential problems by abiding by the GPL as it applies to WordPress.

Chapter 2 The license must not restrict anyone from making use of the program in Exploring the World

  The rights attached to the program must apply to all to whom the pro- gram is redistributed without the need for execution of an additionallicense by those parties. If the programis extracted from that distribution and used or distributed within the terms of the program’s license, all parties to whom the program is redis-tributed should have the same rights as those that are granted in con- junction with the original software distribution.

26 Defining Open Source

  Actually, WordPress requires the pres- ence of PHP on your Web server for you to run the WordPress platformsuccessfully on your site.✦ MySQL (http://mysql.com): The world’s most popular open source database. Rather, opensource is a movement — some consider it a philosophy — created and pro- moted as a way to provide software as a public resource open to communitycollaboration and peer review.

Chapter 2 Exploring the World If you are bored, read the GPL text at http://www.gnu.org/licenses/ of Open Source

  (That said, providing on your Book I site at least one link back to the WordPress Web site is common courtesy and a great way of saying thanks.) Exploring the World of Open Source Most regular users of WordPress aren’t even aware of the software licensing Software because it doesn’t affect the day-to-day business of blogging and publishing their sites with the platform. However, it’s not a bad idea to educate yourselfon the basics of the GPL and try to be certain that any plugins and themes you use with your WordPress installation abide by the GPL so that youhave peace of mind that all applications and software you’re using are in compliance.

Chapter 2 Exploring the World

  ✦If you charge for your work, which is compliant with the GPL, the licens- of Open Source ing doesn’t change and users still have the freedom to modify your work Software and rerelease it under a different name. Although this practice complies with the GPL, it won’t beapproved for inclusion in the WordPress Plugin Directory.

Chapter 3: Understanding Development and Release Cycles In This Chapter

  ✓ Delving into WordPress release cycles✓ Exploring betas, release candidates, and final release versions✓ Navigating WordPress release archives✓ Tracking WordPress development✓ Using bleeding-edge builds f you’re planning to dip your toe into the WordPress waters (or you’vealready dived in and gotten completely wet) the WordPress platform’s I development cycle is really good to know about and understand because it affects every WordPress user on a regular basis. To make sure that you’re running the most up-to-date and secure version, upgrade tothe latest release as soon as you can.✦ New features: Major WordPress releases (I discuss the difference between major versus minor, or point, releases later in the chapter), offer great new features that are fun to use, improve your experience,and boost your efficiency and productivity.

Chapter 3 WordPress. Generally, plugin and theme developers don’t worry about Development and

  The beta process continues until the development team decides that the software is ready to move into the next phase in the develop-ment cycle.✦ Release Candidate: A version becomes a release candidate (RC) when the bugs from the beta versions are fixed and the version is nearly ready for final release. You sometimes see several release candidate iterations,referred to as RC-1, RC-2, and so on.✦ Final Release: After a version has gone through full testing in several (hopefully all) types of environments, use cases, and user experiences, any bugs from the alpha, beta, and RC phases have been squashed, andno major bugs are being reported, the development team releases the final version of the WordPress software.

38 Keeping Track of WordPress Development

  (You can download a free IRC program called mIRC from www.mirc.com for PC users, or a program called Ircle from www.ircle.com forMac users. Follow the program’s user manual for instructions on how to use IRC to chat via the Internet). ✦ WordPress Trac (http://trac.wordpress.org): Here are ways to stay informed about the changes in WordPress development: ✦ WordPress mailing lists (http://codex.wordpress.org/Mailing_ Lists ):Join mailing lists focused on different aspects of WordPress develop- ment, such as bug testing, documentation, and hacking WordPress.

Chapter 3 WordPress development moves pretty fast. Often, changes in the WordPress Development and Release Cycles Understanding

  While the developers are work- ing on alpha and beta versions and release candidates, they will commit thelatest core changes to the repository and make those changes available to the public to download, install, and test on their own sites. They helpby downloading the nightly builds, testing them in various server environ- ments, and reporting to the WordPress development team by way of Tractickets (shown in Figure 3-3; check out http://core.trac.wordpress.org/report) any bugs and problems they find with that version of the software.

40 Downloading Nightly Builds

  WP Beta Tester (http://wordpress.org/extend/plugins/wordpress- beta-tester) is a super plugin that allows you to use the automaticupgrade tool in your WordPress Dashboard to download the latest nightly build. Running the latest nightly build on your Web site is referred to as using bleeding-edge software because it’s an untested version requiring you to take risks just to run it on your Web site.

Chapter 4: Introducing the WordPress Community In This Chapter

  This chapter introduces you to the WordPress community and the benefits of membership within that community, such as where to find support,how to locate other WordPress users on various social networks, get- ting support and assistance from other users, how you can participate inWordPress development, and hooking up with WordPress users face to face at WordPress events, such as WordCamp. Point is, WordPress users are all over the Internet from Web sites to dis- cussion forums and social networks to podcasts, and more; and for manypeople, the appeal of the WordPress platform lies not only in the platform itself — but in its passionate community of users.

44 Users Helping Users

  All contributors to the Codex are WordPress users who donate their time as a way of giving back to the free, open source project that has given them a dynamic piece of software for publishing freely on the WordPress Community Introducing the Web. Here are some of the many services available:✦ Custom graphic design and CSS styling for your blog✦ Custom templates✦ WordPress plugin installation and integration✦ Custom WordPress plugins✦ WordPress software installation on your Web server✦ Upgrades of the WordPress software✦ Web hosting and domain registration services✦ Search engine optimization and site marketingSome bloggers take advantage of the full array of services provided, whereas others use only a handful.

Chapter 4 We see services range from $5 per hour to $300 per hour — and all points

  These folks are the ones you want tocontact when you’re looking for someone to create a nice, unique design for your Web site that is an individual, visual extension of you or your company,such as my own Premium WordPress theme business shown in Figure 4-2. A developer can take some of theunderlying code, make a little magic happen between PHP and the MySQL database that stores the content of your blog, and create a dynamic displayof that content for you.

Chapter 4 Who They Are Where You Can Find Them the WordPress Community Introducing Crowd Favorite http://crowdfavorite.net/wordpress

  Here are several ways you can contribute to the project, includ- ing, but not limited to, code: ✦ Code: One of the more obvious ways users can contribute to WordPress is by providing code to be used in the core files. Be sure to check out the article in the Codex titled “Codex: Contributing” (http://codex.wordpress.org/Codex:Contributing), which provides good tips on how to get started, including guidelines for documentationcontributions.✦ Tutorials: Do you feel like you have a few tips and tricks you want to share with other WordPress users?

Chapter 4 Not only can you find out about WordPress and contribute to the proj- the WordPress

  Typically, speakers, organizers, and attendees are from the same area and enjoy gathering on a monthly or bimonthly basis.✦ WordCamps: These annual WordPress events are usually much larger than MeetUps and are attended by people from all over the coun- try. You can find a WordPress MeetUp near your community by visiting theMeetUp Web site at http://meetup.com or by performing a search, using the keyword WordPress and your city or zip code.

Chapter 5: Discovering Different Versions of WordPress In This Chapter

  One version is a hosted platform available at WordPress.com that meets the needs of bloggers who do not want to worry about installing or dealing withsoftware; the other is the self-hosted version of the WordPress software available at http://wordpress.org, which offers users a bit more free-dom and flexibility, as described throughout this chapter. Comparing the Two Versions of WordPress The two versions of WordPress are✦ The hosted version at WordPress.com✦ The self-installed and self-hosted version available at WordPress.orgCertain features are available to you in every WordPress blog setup, whether you’re using the self-hosted software from WordPress.org or thehosted version at WordPress.com.

Chapter 5 Discovering Different Versions of WordPress

  The support forums are very much a community of users helping other users, and you can generally obtain a solution to yourWordPress needs here from other users of the software.✦ Roadmap (http://wordpress.org/about/roadmap): This section of the WordPress.org Web site doesn’t contain support information or tools that you can download; it offers an at-a-glance peek at what’s newand upcoming for WordPress. You can usually obtain a good Web hosting service for anywhere from $5 to $10 per month.(Book II, Chapters 1 and 2 give you some great information on Web hosting accounts and tools.) However, you need to make sure that any Web host youchoose to work with has the required software installed on the Web server.

60 Hosting Multiple Sites with One WordPress Installation

  If you have a knack for PHP and knowledge ofMySQL, you can work within the code to make changes that you think would be good for you and your blog. However, if you plan to host a large network with hundreds of blogs and multiple users, youshould consider contacting your host and increasing your bandwidth and the disk space limitations on your account.

62 Discovering WordPress VIP Services

  Many WordPress network communities start with grand dreams of being a large and active community — be realistic on how your community willoperate in order to make the right hosting choice for yourself and your community. Although Automatticdoesn’t own the WordPress.org software (as an open source platform,WordPress.org is owned by the community and hundreds of developers that contribute to the core code), Automattic is a driving force behind all thingsWordPress.

Chapter 1: Understanding the System Requirements In This Chapter

  Obtaining a Web server and installing software on it is something you may already have done on your site; in which case, you can move on to the nextchapter. This chapter takes you through the basicsof those technologies, and by the last page of this chapter, you’ll haveWordPress successfully installed on a Web server with your own domain name.

68 Establishing Your Domain

  Be aware, how- and start using them for their own Web sites, in ever, if you don’t renew the domain name when the hope of taking full advantage of the popular-your registration period ends, you lose it — and ity that the previous owners worked so hard to most often, you lose it right away to someone attain for those domains. Considering the cost of a domain name Registering a domain costs you anywhere from $3 to $30 per year, depending on what service you use for a registrar and what options (such as privacyoptions and search engine submission services) you apply to your domain name during the registration process.

Chapter 1 Understanding the System Requirements

  Although hundreds of domain regis- trars exist, the ones in the following list are popular because of their longev-ity in the industry, competitive pricing, and the variety of services they offer in addition to domain name registration (such as Web hosting and Web sitetraffic builders): Network Solutions: http://register.com✦ Register.com: http://godaddy.com✦ http://networksolutions.com✦ The next step is obtaining a hosting account, which we cover in the next section. Because you intend to run WordPress on your Web server, you need to look for a host that provides the minimum requirements needed to run the soft-ware on your hosting account, which are ✦PHP version 4.3 (or greater) ✦MySQL version 4.0 (or greater) The easiest way to find whether a host meets the minimum requirement is to check the FAQ (Frequently Asked Questions) section of the host’s Web site,if it has one.

Chapter 1 When looking into different Web hosting providers, ask about their policy

  on CPU use and what they do to manage a spike in processing. It’s better Understanding Requirements to know about it upfront, than to find out about it after your site’s been the System throttled.

Chapter 2: Using File Transfer Protocol In This Chapter

  FTP is a way of moving files from oneplace to another, such as: ✦ Uploading: Transferring files from your local computer to your Web server✦ Downloading: Transferring files from your Web server to your local computerYou can do several other things with FTP, including the following, which we discuss later in this chapter: 78 Setting Up FTP on Your Hosting Account CHMOD, it controls what type of read/write/execute permissions the files on your Web serverhave. (In the future, if you add a new FTP user, you can limit the amount of space, in Megabytes (MB) by selecting the radio button to theleft of the text field and typing the numeric amount in the text box; for example: 50MB.) Click the Create FTP Account button.


  By following the steps in the previous section, you also have the FTP username, password, server, and port informationyou need to connect your FTP client to your Web server so you can begin transferring files. If you use a different FTP client software than FileZilla, the steps and look of the software will differ, and you will need to adapt your steps and practicefor the specific FTP client software you are using.

Chapter 2 software. Using File Transfer Protocol Enter the FTP server in the Host field

  The directory of fold- ers and files from your local computer display on the left side of theFileZilla FTP client window, and the directory of folders and files on your Web server display on the right side, as shown in Figure 2-5. Within the FTP client software, youcan browse the directories and folders on your local computer on the left side and browse the directories and folders on your Web server on the rightside.

Chapter 2 Using File Transfer Protocol

  To upload a file from your computer to your Web server, click the file you want to transfer from your local computer anddrag and drop it onto the right side (the Web server side).✦ Downloading: Transferring files from your Web server to your local computer. On a very simplistic level, these permissions include: Changing file permissions When you edit files by using the FTP edit feature, you are editing files in a“live” environment; meaning that when you save the changes and upload the file, the changes take effect immediately and affect your live Web site.

90 Exploring PHP Basics PHP is a server-side scripting language for creating dynamic Web pages

  The PHP programming languagereceives that request, makes a call to the MySQL database, obtains the requested information from the database, and then presents the requestedinformation to your visitor through his Web browser. Exploring PHP Basics 91 Before you play around with template tags (covered in Book VI) in your WordPress templates or plugin functions, you need to understand what makes up a template tag and why, as well as the correct syntax, or func-tion, for a template tag as it relates to PHP.

Chapter 3 request to the database that tells WordPress to grab the data and display it. Introducing PHP A typical template tag, or function, looks like this: and MySQL

  <?php get_info(); ?> This example tells WordPress to do three things:✦ Start PHP: <?php ✦ Use PHP to get information from the MySQL database and deliver it to your blog: get_info(); ✦ Stop PHP: ?> In this case, get_info() represents the tag function, which grabs informa- tion from the database to deliver it to your blog. (Note: AllHTML tags need to be opened and then closed, just like PHP tags that we describe in the preceding section. In this case the <title> tag opensthe command, and the </title> tag closes it and tells the Web browser that you’re finished dealing with the title).

10. This tells the Web browser that you’re at the end of the HTML document

  When you’re done with Steps 1–10, double-check that the code in your text editor looks like this: Book II<html> <head> <title>This is a Simple PHP Page</title>Introducing PHP </head>and MySQL <body> <?php echo ‘<p>Testing my new PHP function</p>’; ?></body> </html> After you write your code, follow these steps to save and upload your file: Save the file to your local computer as testing.php. After WordPress is installed on your server (which I discuss in Chapter 4 of this minibook), the database gets populated with 11 tables that exist to storedifferent types of data from your WordPress blog.

Chapter 3 Introducing PHP and MySQL

  When the Multisite feature in WordPress is activated (check out Book VIII Book II for information about the Multisite feature), WordPress adds six additional tables in the database: Introducing PHP ✦ wp_blogs : This table stores information about each blog created in and MySQL your network, including ✦ wp_blog_versions : This table stores general information about each network blog ID, database version, and date of last update. ✦ wp_registration_log : This table stores information about registered users, including ✦ wp_signups: This table stores information about user sign-ups that includes all the information from the wp_registration_log table, the date the user account was activated, and the unique activation key theuser accessed during the sign-up process.✦ wp_site : This table stores information about your main installation site including the site ID, domain, and server path.

a. Browse to yourdomain.com/cpanel (where yourdomain

  Enter your specific hosting account username and password in the login fields and then click OK. The Fantastico page loads in your browser window and displays a list of available scripts on the left side of the page, as shown in Figure 4-1.

3. The WordPress page loads, displaying a short description of WordPress

  If you installed WordPress byusing the Fantastico method and don’t want to review the steps to installWordPress manually, flip to Chapter 5 in this minibook to optimize your WordPress installation for performance and security. This doesn’t include the time to register a domain name; thetime to obtain and set up your Web hosting service; or the time to download, install, configure, and figure out how to use the FTP software.

a. Browse to http:// yourdomain.com/cpanel (where yourdomain

  com is your actual domain name) to bring up the login screen for your cPanel. Enter your specific hosting account username and password in the login fields, and then click OK.

2. Click the MySQL Databases icon to load the MySQL Databases page in your cPanel

  Installing the WordPress Files105 Enter a name for your database in the Name text box. Book II Scroll to the approximate middle of the page to locate this section.

Chapter 4 Choose a username and password for your database, enter them in WordPress on Your 7

  Uploading the WordPress files via FTP To upload the WordPress files to your host, return to the /wordpress folder (shown in Figure 4-4) on your computer where you unpacked theWordPress software that you downloaded earlier. Here are a few things to keep in mind when you upload your files: ✦ Upload the contents of the /wordpress folder to your Web server —not the folderitself.

Chapter 4 Click the Create a Configuration File button

  Dig out the database name, username, and password that you saved 4.in the earlier section “Setting up the MySQL database,” and use thatinformation to fill in the following fields, as shown in Figure 4-6: the MySQL database before this installation. If you happen to lose this page before clicking the Log In button, you can always find your way to the login page by entering your domain followed by the call to the login file (for example, http://yourdomain.com/wp-login.php — where yourdomain is your domain name).

Chapter 5: Configurations for Optimum Performance and Security In This Chapter

  ✓ Exploring the configuration file✓ Caching data to increase speed and performance✓ Using text editors and browsers to edit and test your site n Chapter 3 of this minibook, I show you the basics of PHP (Hypertext Preprocessor), the programming language that WordPress is built on, as I well as the MySQL database system that stores the data for your Web site. Additionally, WordPress is somewhat vulnerable to hacking attempts; however, you can take a fewsteps to make it much more difficult (if not impossible) for hackers to exploit the files on your Web server and improve the overall security ofyour WordPress Web site.

2. This secures the file from being seen by any bots or search engines

Book II on the Web: <Files wp-config.php>Performance and Order Allow,DenyConfigurations for Optimum Deny from allSecurity </Files> Save the new .htaccess file and upload it to your Web server.

3. Your

  Discovering the Configuration File119 Follow the directions in the file and visit the WordPress secret-key serviceWeb page (https://api.wordpress.org/secret-key/1.1/salt; be sure to refresh this page a few times to make sure that you get uniquekeys) to obtain the keys that you need to replace the existing defaults (rep- resented in the wp-config.php file by the lines that start with define. You can limit the number of revisions that WordPress will save by adding the following line to thewp-config.php file: define (‘WP_POST_REVISIONS’, 3); // limit number of revisions to 3 You can also completely disable the default revision feature by adding this line to the wp-config.php file, on its own line: define (‘WP_POST_REVISIONS’, false); // disable post revisions WordPress creates these revisions through the Autosave feature.

Dokumen baru