• Resolved artair

    (@artair)


    Hi there,

    we’re trying to add some logos inside the theme-header (Storefront / Bookshop).
    I’m testing with something as simple as:

    function test123()
    {
        echo '<p style="color: red">TEST</p>';
    }
    add_action('storefront_header', 'test123', 42);

    When I use add_action('storefront__before_header', 'test123', 42); everything is fine, storefront_header doesn’t do anything (regardless of priority).

    Is this a bug or do I miss something?

    Thanks in advance!
    Artair

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter artair

    (@artair)

    More testing & deactivating plugins revealed: storefront powerpack was the problem. After deactivating, the hook works again as expected.

    If it is a general powerpack problem or just in combination with bookstore child theme I don’t know. Switching to Storefront vanilla without childtheme didn’t resolve the problem, deactivating powerpack did.

    Hi @artair,

    I gave that snippet a test with both storefront_header and storefront_before_header with PowerPack and BookShop active. The test message did display in both cases for me.

    before_header

    header

    I did not alter the priorities. I ran the snippets through the Code Snippet plugin.

    The only thing I noticed was storefront__before_header needs to have just one underscore (storefront_before_header), but that doesn’t explain the issue with storefront_header though.

    Are you running the most recent version of PowerPack (1.5.0)?

    Thread Starter artair

    (@artair)

    Hi @3sonsdevelopment,

    thank you for testing this out!
    The additional underscore was just a typo here in my text.
    The Version of PowerPack is 1.5.0. I tested again, when I activate PowerPack, “TEST” goes away.

    Maybe it’s some incompatibility between powerpack & some other plugin which has no other visible effect but this strange behaviour with storefront_header I thought next…?

    But in the last hour I deactivated every other plugin, the only active plugins left are:
    Powerpack, WooCommerce (3.6.5, then updated to 3.7.0) and the drop-in plugin with the code-snipped for testing from above.

    Header stays the same and “TEST” isn’t displayed until I deactivate PowerPack. Then TEST appears again.

    Do you have any idea? I noticed some code in bookstore *specific* for/”against” PowerPack (deactivating some overridden functions I think) – perhaps there is the problem somewhere?

    Bookshop Version is 1.0.18 btw and StoreFront Version: 2.5.1.

    Hello @artair,

    That is perplexing. I tested with the same versions of PowerPack, BookStore and Storefront, but didn’t have any trouble getting test to show up with those three.

    You may have already done this, but have you run a text search on the source code of the page to make sure “TEST” is there, but is just being hidden? Outside of that extra underscore, I didn’t change anything in the code when I tested it on my site. I wondered if some styling set in PowerPack was causing it to not be visible.

    Let me know if “TEST” is missing from that page’s source.

    Thanks,

    Thread Starter artair

    (@artair)

    Hello @3sonsdevelopment,

    yes, I looked at the source code & did the search in source code (that was my first guess, that it just wasn’t visible). TEST isn’t in the source, too.

    Can it have something to do with any configuration from powerpack?

    Thanks,
    Artair

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Storefront hook storefront_header: can’t insert any content’ is closed to new replies.