• Aucun résultat trouvé

Customizing Your Widgets

Dans le document Matthew MacDonald WordPress (Page 153-158)

You’re not done tweaking yet. Although your theme may look a whole lot nicer, there’s still one area that most WordPress site creators will want to change: the sidebar.

The sidebar is a terrifically useful place to put links, like the ones that let your visitors browse your archives. It’s filled with something WordPress calls widgets. A widget is simply a block of useful content (like a list of links) that you can stuff into a side-bar, or put somewhere else in your site layout (Figure 5-9), Here’s the neat part:

your WiDgeTs nearly all of them).

Widgets

Figure 5-9

Widgets are like building blocks for your website. In a freshly cre-ated WordPress site, you start with the six widgets shown here.

 NoTE  Technically, the theme you choose provides one or more areas for widgets to go (like a sidebar and a footer). It’s up to you to choose what widgets go in those areas, and to configure the widgets you add. The best part of this system is that you can use your favorite widgets with any theme.

your WiDgeTs To see the widgets you can use, choose Appearance→Widgets. This takes you to a

densely packed Widgets page, which is a bit confusing because it shows you two things at once:

All the widgets WordPress has to offer. In the big box on the left, under Avail-able Widgets, is a long list of all WordPress’s widgets, including those you’re using and those you aren’t, in alphabetical order.

The widgets you’re currently using. On the right, below headings like Sidebar and Footer Area, are the widgets that are active on your site right now. Word-Press arranges these widgets in individual boxes (based on what part of the site they occupy) and lists them in the order they actually appear.

Each theme dictates where you can place widgets. If you just created a new Word-Press site, you’ll start with a Widgets page that looks like Figure 5-10.

All the WordPress widgets The widgets in your sidebar Figure 5-10 The Twenty Eleven theme offers five locations for widgets: a sidebar, a special showcase sidebar (discussed on page 225), and three footer areas.

Right now, the sidebar is the only section that actually has any widgets in it. As you can see, the six widget boxes shown here correspond to the six widgets on the site, shown in Figure 5-9.

your WiDgeTs theme sidebar appears on the home page, but not on the page that you see when you’re reading an individual post. But the Brightpage theme (demonstrated on page 186) uses a sidebar on the main post page, and the same sidebar on the single-post page. Other variations are possible—it all depends on your theme.

The easiest thing you can do on the Widgets page is move a widget. That’s as simple as dragging the widget to a new spot. Why not try relocating the Search box to the bottom of the sidebar? There’s no need to click any button to save your changes—as soon as you drop the widget in its new position, WordPress makes the change and you can view your site to check out the effect.

The next-easiest widget-customization task is deleting a widget. Simply grab hold of your widget and drag it over to the big Available Widgets box on the left. When you drop the widget there, WordPress removes it from your site.

 TIP  Congratulations, you’ve now graduated to the second level of WordPress mastery! It’s time to delete the Meta widget from the main sidebar. Although its login and site administration links are convenient for you, they look unprofessional to your readers. In the future, you’ll need to type in your dashboard’s address (just add /wp-admin to the end of your website address) or bookmark the dashboard in your web browser.

Next, you can try adding a widget by dragging it from the Available Widgets box and dropping it on your sidebar. (You’ll learn what all these widgets actually do starting on page 147.)

As you get a bit more ambitious, you may want to try moving widgets to different areas. For example, you might want to move the Categories widget from the main sidebar to a footer area. Before you can do that, you need to make sure you expand the area where you want to put the widget. In Figure 5-10, the Main Sidebar area is expanded, but the others are collapsed. To open one (say, Footer Area One), click the down-pointing arrow on the right. Then drag the widget into the newly revealed area (Figure 5-11).

The standard WordPress theme has no fewer than three footer areas for widgets.

Although this seems confusing, it really isn’t—you simply use what you need. If you want a simple footer, use Footer Area One and ignore the others. If you want a two-column footer, which splits the footer area into columns, use Footer Area One and Footer Area Two (Figure 5-12). And if you want a pumped-up three-column footer, you know what to do: put widgets in Footer Area One, Footer Area Two, and Footer Area Three.

your WiDgeTs

Figure 5-11 To move a widget, first expand the destination area (left), and then drag your widget there (right).

Figure 5-12 This site uses Footer Area One and Footer Area Two to create a two-column footer, with one widget in each area. However, under your footer is another footer of sorts—

the “Proudly powered by WordPress” message. The only way to remove this text is to edit your theme;

page 457 shows you how.

your WiDgeTs multiple footer areas that the Twenty Eleven theme offers, you can give your site a fat footer of its own. Other themes may offer only a single footer area, and they may offer additional widget areas, too—like two sidebars, one on either side of the main content area.

Dans le document Matthew MacDonald WordPress (Page 153-158)