This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

Problems loading So content via WP_Query in footer.php on WooCommerce shop page

7 years ago · Last reply by Alex S 7 years ago

Hi,

I’ve had problems loading the SiteOrigin PB content of a post in the footer using WP_Query. I realized that the stylesheet and the scripts from siteorigin-panels haven’t been loaded. This happened only on WooCommerce shop page.
The reason is found in siteorigin-panels.php on line 421-423. There, the post ID is set to the ID of the shop page.
Why? If I uncomment the line, everything works fine!?
Please fix that bug (found in V. 2.10.0).

Thanks,
Kurt

This is our free support forum. Replies can take several days.

Need fast email support? Get SiteOrigin Premium

Replies

5
  1. Alex S Staff 7 years, 27 days ago

    Hi Kurt,

    Would it be possible for you to provide me with a copy of your PHP so I can run some tests? This will, hopefully, allow us to identify how to avoid your code from triggering the WooCommerce checks on lines 421 – 423 which are required for WooCommerce so SitEOrigin Page Builder can be used on the shop page.

  2. kfidel 7 years, 27 days ago

    Sure.

    <?php
    $footerID = 126;
    $post = get_post($footerID); 
    echo apply_filters('the_content', $post->post_content);
    ?>
  3. Alex S Staff 7 years, 26 days ago

    Hi Kfidel,

    Thanks. You can avoid this by setting up a proper query as that will prevent WooCommerce from returning true for is_shop() as the main query is still attached to the shop page (this will also allow you to use the_content()), or you can render SiteOrigin Page Builder directly. For the latter, here’s some example code you could use:

    if ( class_exists( 'SiteOrigin_Panels' ) && get_post_meta( $post_id, 'panels_data', true ) ) {
    	echo SiteOrigin_Panels::renderer()->render( $footerID);
    } else {
    	echo apply_filters( 'the_content', get_post( $footerID)->post_content );
    }
  4. kfidel 7 years, 26 days ago

    Perfect, thanks!

  5. Alex S Staff 7 years, 26 days ago

    Hi Kfidel,

    Awesome, great to hear that helped! :)
    Please be sure to post another thread if you have any other questions.

Replies on this thread are closed.

Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Have a different question or issue?

Start New Thread