Home|About| Archives| Contact Us| Privacy Policy

Where you are? Tag's Archives

There are plenty of WordPress extensions that generate breadcrumb navigation. But you can actually create custom breadcrumb navigation with only a handful of lines of code in the template, opening up greater control and, potentially, less overhead. This approach to breadcrumbs builds on the get_post_ancestors function.

To start with, here is a basic implementation of breadcrumbs that only deals with pages and includes a breadcrumb for “home” (the front page of theblog) at the beginning of the list. Depending on the design of a particular template, some checks may need to placed around this code. In this example, it will be assumed that this code will be placed in the header.php template file, that the crumbs should appear only on pages, and that it should not show up on the front page. The current page and front page link will also be assigned special CSS classes for styling purposes.

Click here to read more …

Page 1 of 11