SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    734
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    any advice or bkm for implementing breadcrumbs in wp?

    hello all.
    Was wondering about implementing breadcrumbs in wp.
    I actually don't think i ever implemented that period. Any advice on how to do that or bkm?
    thx
    D

  2. #2
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    734
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    so went to check online of course

    Found this function online
    Code:
    function the_breadcrumb() {
            echo '<ul id="breadcrumbs">';
        if (!is_home()) {
            echo '<li><a href="';
            echo get_option('home');
            echo '">';
            echo 'Home';
            echo "</a></li>";
            if (is_category() || is_single()) {
                echo '<li>';
                the_category(' </li><li> ');
                if (is_single()) {
                    echo "</li><li>";
                    the_title();
                    echo '</li>';
                }
            } elseif (is_page()) {
                echo '<li>';
                echo the_title();
                echo '</li>';
            }
        }
        elseif (is_tag()) {single_tag_title();}
        elseif (is_day()) {echo"<li>Archive for "; the_time('F jS, Y'); echo'</li>';}
        elseif (is_month()) {echo"<li>Archive for "; the_time('F, Y'); echo'</li>';}
        elseif (is_year()) {echo"<li>Archive for "; the_time('Y'); echo'</li>';}
        elseif (is_author()) {echo"<li>Author Archive"; echo'</li>';}
        elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {echo "<li>Blog Archives"; echo'</li>';}
        elseif (is_search()) {echo"<li>Search Results"; echo'</li>';}
        echo '</ul>';
    }
    and then i call it w/
    Code:
    <?php the_breadcrumb(); ?>
    but I get this
    Parse error: syntax error, unexpected ''<ul id='' (T_CONSTANT_ENCAPSED_STRING) in C:\xampp\htdocs\wordpress\wp-content\themes\cdiDlm03\functions.php on line 163
    I did try to change the " to ` and ' that did nothing.
    Thank you
    D

  3. #3
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    734
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    never mind. found a better function that seems worksin case anyone else needs it;

    http://gilbert.pellegrom.me/how-to-b...s-in-wordpress


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •