Blog Posts

WordPress Tricks Part 4

29 Oct WordPress Tricks Part 4

You can see the first three parts of WordPress tricks by clicking here. We’ll take a look at a few more neat tricks you an use to make your WordPress experience more efficient and flexible.

  1. Add classes to links in the menu – often times you’ll need to style one link. And not the first or the last, but maybe the middle one. Maybe you just want to change the color to orange (or whatever, really). To do this go into appearance > menu. At the top right, you’ll notice a Screen Options tab. Toggle that down, and under “Show advanced menu properties” you’ll see “CSS Classes.” If you check that box, you can now add classes to each link so you can style it appropriately. This will be added to the <li> element and not the actual <a> tag itself. Thus to style the link itself (if you used “highlight” as your class), you would do something like this:
    ul.main-nav li.highlight a {color: orange;}
    You’ll also notice each link has an ID, so why not use that? The link ID is really only used for quick styling and shouldn’t be used, as it can very easily change. If that gets replaced the style will disappear. Furthermore, like in the example above, you could use that method to highlight more than one link.
  2. Make posts always appear first (sticky) – sometimes there are one or two posts, you always want to appear on the front page, or archives pages of your site/blog. Lets say, for example, you have a post that is so comprehensive it links to a bunch of other posts, and so you always want it at the top. The annoying way, would be to change the date of it, every single time you posted another post. To bypass this, from the post itself, in the info on the right under the “Publish” box, edit the visibility. Check the box under the public radio button that says “Stick this post to the front page.”
  3. Edit posts by changing URL – this is a neat trick, that often comes in handy when switching between editing two or three posts at a time. You’ll notice in the URL bar, the URL ends with something like “?post=22&action=edit” that 22 is the post ID. You can change that number, and change which post you’re editing, without having to click back to all your posts and then into the specific post you’re looking for.

That’s all for now! More to come later.

No Comments

Leave a Reply