php spacing issue

Th3 Canadian 3h

Supreme Member
Joined
Jun 15, 2016
Messages
1,358
Reaction score
875
this is what it looks like

no spaces.PNG


I need to add spaces between them and I can't figure it out for the life of me

This is the code in php, I know it's something simple


PHP:
function wwofCategoriesBeforeListing() {
    $args = array(
        'taxonomy'     => 'product_cat',
        'hierarchical' => true,
        'hide_empty'   => true
    );
 
    $all_categories = get_categories( $args );
 
    if ($all_categories) {
        foreach ($all_categories as $cat) {
            echo '<a data-cat-slug="' . $cat->slug . '" class="wwofCatLink" href="'. get_term_link($cat->slug, 'product_cat') .'">'. $cat->name .'</a>';
        }
 
        echo' <script type="text/javascript">
        jQuery(".wwofCatLink").click(function(e) {
            e.preventDefault();
            var catSlug = jQuery(this).data("cat-slug");
            jQuery("select#wwof_product_search_category_filter").val(catSlug);
            jQuery("input#wwof_product_search_form").val("");
            jQuery("input#wwof_product_search_btn").trigger("click");
        });
        </script>';
 
    }
}
 
add_action('wwof_action_before_product_listing', 'wwofCategoriesBeforeListing', 10);
 
The code itself is okay, the problem is that the anchor-elements (<a>) don't have padding on them.
Add a padding-right to .wwofCatLink and it should work :)
 
The code itself is okay, the problem is that the anchor-elements (<a>) don't have padding on them.
Add a padding-right to .wwofCatLink and it should work :)

Awesome thanks bud! Knew I did a noob mistake some where
 
Back
Top