Viewing 11 replies - 1 through 11 (of 11 total)
  • Roy Ho

    (@splashingpixelscom)

    May I ask what styling you’re trying to add?

    Also you said “it doesn’t seem to work”. Can you be more specific? Area you meaning it filters it but in the wrong location in terms of pages or are you saying it is not filtering at all?

    Because according to your code, it should work.

    However I would change this line to be more flexible:

    return '<span>' . $page_title . '</span>';

    So you’re not hardcoding the “Shop” text in there.

    Thread Starter Paul de Wouters

    (@pauldewouters)

    yeah, it’s a background color on the span so the horizontal line doesn’t show through.
    here’s a page where it works
    https://vli.wpengine.com/contact/

    by the way, woocommerce should make sure WordPress native filters still work like ‘the_title’

    Roy Ho

    (@splashingpixelscom)

    Please read my updated comment.

    Thread Starter Paul de Wouters

    (@pauldewouters)

    thanks for trying to help out and sorry for the “it doesn’t work” ??
    actually it outputs this

    <h1><sppan></span></h1>
    <h1>Shop</h1>

    Roy Ho

    (@splashingpixelscom)

    Are you sure you don’t have other filters causing that? Because the code you provided alone, will work, I just tested it.

    Thread Starter Paul de Wouters

    (@pauldewouters)

    interesting. I just switched to twenty twelve and disabled all other plugins and put the filter in functions.php but no luck.
    also, I set a breakpoint inside the callback but it’s not stopping so for some reason the filter isn’t being called

    Roy Ho

    (@splashingpixelscom)

    Well take note of your conditional inside. Are you on a product archive page? How about removing that conditional for a test and see if it works.

    Roy Ho

    (@splashingpixelscom)

    Also try removing your priority…So remove the “15” from the add_action.

    Thread Starter Paul de Wouters

    (@pauldewouters)

    so, this is a genesis child theme. I now installed the genesis connect templates in the child theme, and noticed that the title actually does use
    apply_filters('the_title'... but it’s missing the $id argument
    look at line 254 of template-loader.php, there should be an $id parameter.
    So now I have to have a different callback for the woocommerce pages.
    I still don’t know how to apply the filter to only the main title on the page instead of all the nav menu items and the product titles on the shop page
    this is getting much more involved that I expected.
    I wish there was an easy CSS solution. Or maybe I’ll use javascript

    Roy Ho

    (@splashingpixelscom)

    I am not familiar with Genesis so I don’t know how they have setup their filters but regardless of that, the filter you’re using in the code you provided is already specific to WC so it shouldn’t affect your menu items.

    The test I did which works fine was on the default 2012 theme.

    Thread Starter Paul de Wouters

    (@pauldewouters)

    ok, so turns out the Genesis Connect plugin templates are in need of an update for Woocommerce 2.0
    I managed to update them on my install and it seems to be ok for now. I’ll do some more testing and report back, in case someone else has the same issue
    thanks for your help!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘wrap shop title with span’ is closed to new replies.