Breadcrumbs & Hide blog on homepage

Discussion in 'SaleJunction E-Commerce WordPress Theme' started by ronnies, Feb 1, 2015.

Thread Status:
Not open for further replies.
  1. ronnies

    ronnies Member

    Joined:
    Jan 13, 2015
    Messages:
    63
    Likes Received:
    1
    Hi guys,
    A couple of questions, hope you're not tired of me :)

    1. How do I add breadcrumbs to the shop?

    2. Is there a way to hide the blog posts on the front page? Right now it says "Youy have not posted any blog yet"- because I don't use the blog. How do I hide it?
    When I try to add the "display: none;" code to "feature_content_inner_box1" it hides the three columns above too, which I want to display.

    Thanks!
     
  2. Pramod

    Pramod Guest

    Joined:
    Aug 8, 2014
    Messages:
    2,847
    Likes Received:
    63
    Hello !

    Breadcrumb is not available in Theme. For this you have to to custom coding.
    PHP:
    <?php
     
    function the_breadcrumb() {
        if (!
    is_home()) {
            echo 
    '<a href="';
            echo 
    get_option('home');
            echo 
    '">';
            echo 
    'Home';
            echo 
    "</a> >> ";
            if (
    is_category() || is_single()) {
                
    the_category('title_li=');
                if (
    is_single()) {
                    echo 
    " Â» ";
                    
    the_title();
                }
            } elseif (
    is_page()) {
                echo 
    the_title();
            }
        }
    }
    ?>
    Use above code in functions.php at the end of file and below in page.php.
    PHP:
    <?php the_breadcrumb(); ?>
    Follow below image for breadcrumb
    sale-2feb-breadcrumb.png


    For removing blog section you have to delete highlighted code in index.php shown in image.
    salejunction-front-2feb.png

    Thanks
    Pramod
     
  3. ronnies

    ronnies Member

    Joined:
    Jan 13, 2015
    Messages:
    63
    Likes Received:
    1
    Hi again Pramod!

    First of all - thank you so much again for your help!
    I managed to remove the blog (10x!) and I've added the breadcrumbs - but for some reason, they only show on pages (such as "about" or "contact us") but not on the shop itself. What code should I add?

    Thanks again :cool:
     
  4. ronnies

    ronnies Member

    Joined:
    Jan 13, 2015
    Messages:
    63
    Likes Received:
    1
    Hi again,

    OK, I changed the code a bit:

    Code:
    function the_breadcrumb() {
        if (!is_home()) {
            echo '<a href="';
            echo get_option('home');
            echo '">';
            echo 'Homepage';
            echo "</a> >> ";
            if (is_category() || is_single()) {
                the_category('title_li=');
                if (is_single()) {
                    echo '<a href="';
                    echo '">';
                    echo the_category;
                    echo "</a> >> ";               
                    the_title();
                }
            } elseif (is_page()) {
                echo the_title();
            }
        }
    }
    ?>
    I want the items to show the breadcrumbs as:
    Homepage > Shop page > Category > Item title

    And right now it shows Homepage > the_category > Item title
    How to I change the "the_category" to the title of the category & add a link to the shop after the Homepage?
     
  5. ronnies

    ronnies Member

    Joined:
    Jan 13, 2015
    Messages:
    63
    Likes Received:
    1
  6. Pramod

    Pramod Guest

    Joined:
    Aug 8, 2014
    Messages:
    2,847
    Likes Received:
    63
    Hello ronnie!

    Please use ','(comma) in above code in place of 'title_li='
    this will resolve your issue.

    Thanks
    Pramod
     
  7. ronnies

    ronnies Member

    Joined:
    Jan 13, 2015
    Messages:
    63
    Likes Received:
    1
    Hi again Pramod!

    Thanks for your help! But for some reason it still shows the same. This is the code:
    Code:
    function the_breadcrumb() {
        if (!is_home()) {
            echo '<a href="';
            echo get_option('home');
            echo '">';
            echo 'עמוד הבית';
            echo "</a> >> ";
            if (is_category() || is_single()) {
                the_category('');
                if (is_single()) {
                    echo '<a href="';
                    echo '">';
                    echo the_category;
                    echo "</a> >> ";               
                    the_title();
                }
            } elseif (is_page()) {
                echo the_title();
            }
        }
    }
    ?>
     
  8. Pramod

    Pramod Guest

    Joined:
    Aug 8, 2014
    Messages:
    2,847
    Likes Received:
    63
    Hello ronnies!

    Please try this code.
    PHP:
    function the_breadcrumb() {
        if (!
    is_home()) {
            echo 
    '<a href="';
            echo 
    get_option('home');
            echo 
    '">';
            echo 
    'עמוד הבית';
            echo 
    "</a> >> ";
            if (
    is_category() || is_single()) {
                
    the_category(',');
                if (
    is_single()) {
                    echo 
    '<a href="';
                    echo 
    '">';
                    echo 
    the_category();
                    echo 
    "</a> >> ";             
                    
    the_title();
                }
            } elseif (
    is_page()) {
                echo 
    the_title();
            }
        }
    }
    ?>
    Thanks
    Pramod
     
  9. ronnies

    ronnies Member

    Joined:
    Jan 13, 2015
    Messages:
    63
    Likes Received:
    1
    Hi again Pramod!

    Thanks a lot, but now it shows up blank :(
    http://ronnies-linux.evh732.evhost.co.il/shop/cushions/כרית-פשתן-פסים-דקים-אפור/
    (I added another link after the homepage to the code as you can see)

    This is my current code:
    Code:
    function the_breadcrumb() {
        if (!is_home()) {
            echo '<a href="';
            echo get_option('home');
            echo '">';
            echo 'עמוד הבית';
            echo "</a> >> ";
            if (is_category() || is_single()) {
                the_category(',');
                if (is_single()) {
                    echo '<a href="/shop/">חנות אונליין</a> >> ';
                    echo '<a href="';
                    echo '">';
                    echo the_category();
                    echo "</a> >> ";           
                    the_title();
                }
            } elseif (is_page()) {
                echo the_title();
            }
        }
    }
    ?>
     
  10. Pramod

    Pramod Guest

    Joined:
    Aug 8, 2014
    Messages:
    2,847
    Likes Received:
    63
    Hello !

    Please try below code.

    function the_breadcrumb() {
    if (!is_home()) {
    echo '<a href="';
    echo get_option('home');
    echo '">';
    echo 'Home';
    echo "</a> >> ";
    if (is_category() || is_single()) {
    the_category(',');
    if (is_single()) {

    echo '<a href="';
    echo '/shop/';

    echo '">';
    echo 'חנות אונליין';
    echo "</a> >> ";

    echo '<a href="';
    echo '">';
    echo the_category();
    echo "</a> >> ";
    the_title();
    }
    } elseif (is_page()) {
    echo the_title();
    }
    }
    }
    ?>

    Thanks
    Pramod
     
  11. ronnies

    ronnies Member

    Joined:
    Jan 13, 2015
    Messages:
    63
    Likes Received:
    1
  12. Pramod

    Pramod Guest

    Joined:
    Aug 8, 2014
    Messages:
    2,847
    Likes Received:
    63
    Hello ronnies !


    You can use this line in single-product.php
    PHP:
    <?php woocommerce_breadcrumb$args );?>
    This will show breadcrumb according to woo commerce.

    Thanks
    Pramod
     
  13. ronnies

    ronnies Member

    Joined:
    Jan 13, 2015
    Messages:
    63
    Likes Received:
    1
    Hi Pramod!!
    It worked!!! :D thank you so so much for your great patience and help!
     
Thread Status:
Not open for further replies.

Share This Page