Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #38250
    Jameson
    Participant

    Hi, Support! Really love the theme – it’s one of the best purchases I’ve made lately. I’ve gone back and forward with the stacks with my shop, and I’ve settled on the Integrity stack for doing the most of what I want with my first store (with some CSS edits, of course). However, I’ve run into a wall, and I think I’ve checked just about all of your originally-overwhelming but ultimately-fantastic documentation, plus the forum search.

    1. I’m trying to add content (probably a banner) with a little padding-bottom above the populated content of the shop, including the sidebar. How would I go about doing so?

    2. Certain pages (checkout, cart, etc) won’t need the sidebar. Fiddling with the template doesn’t do the trick. How do I determine which pages can skip loading it?

    I had a few more questions (sidebar -> background color, elements -> background color, elements -> borders, etc), but I’ve managed to sort out how to fix those by utilizing CSS edits and figuring out how the elements are referenced in the coding.

    Thanks a ton!

    #38417
    Colin M
    Participant

    Please share your CSS edits for styling the sidebar. I am trying to do that but can’t figure out how. 🙁

    #38624
    Alexander
    Keymaster

    Hi there!

    Jameson, you could adds something like this to functions.php of a child theme.

    add_action('woocommerce_before_main_content','custom_shop_before_main_content');
    
    function custom_shop_before_main_content() { ?>
      <!--your banner here-->
    <?php
    }

    You can change sidebar conditions by overriding the sidebar template in a child theme. For example: x/framework/views/renew/wp-sidebar.php

    It will take some coding knowledge, but that’s the best place to determine whether or not the sidebar should be loaded.
    You can code in your conditions and set the $layout variable.

    Colin, I’d recommend checking our CSS Class Index. If you have any specific questions, feel free to open your own thread.

    Take care!

    #39548
    Jameson
    Participant

    There’s a huge problem that surfaces when I add that…the white screen of death.
    I tried it a number of times, always performing the following steps:

    1. Remove prior crashed child theme via FTP
    2. Re-upload child theme
    3. Live Preview > Save and Activate
    4. Open the site to double-check (although WP-ADMIN is down when crashed anyway)
    5. Check Customizer settings
    6. Open “functions.php” under the child theme
    7. Add the text
    8. Save
    9. Witness crash

    I’ve attempted this with several different things, since I know coding but not PHP (and ran it past some programmer friends), but I cannot figure out for the life of me why it crashes my site every time I try to implement it. I’ve made sure it’s gone into the “functions.php” page and for that specific child theme every time, and I’m at a loss.

    Halp!

    EDIT: Ran the entire “functions.php” (which includes no changes besides your suggested one) through an online PHP analysis, and it checks out. So I’m cruising through Shrug City right now. I’ll leave it be and continue putting together the banner and the resources it was going to link to, and wait to here what could fix it.

    #39817
    Alexander
    Keymaster

    Hi Jameson,

    A white screen usually means there is a fatal PHP error. Can you please enable WP_DEBUG mode? You can do this by opening wp-config.php and adding define( 'WP_DEBUG' , true ); just above /* That's all, stop editing! Happy blogging. */

    For example:

    When you revisit the page with the white screen, you should have some error output. Let us know what you find out.

    #40180
    Jameson
    Participant

    Hi Support,

    Fatal error: Cannot redeclare custom_shop_before_main_content() (previously declared in /home2/theramp3/public_html/thefairnecessities/wp-content/themes/x-child-integrity-light/functions.php:13) in /home2/theramp3/public_html/thefairnecessities/wp-content/themes/x/functions.php on line 112

    This is the output. Since it’s very specific, and I understand what it’s telling me, I’ll look into this and see if I can fix it myself.

    EDIT: Original problem fixed, but. Apparently, at some point I accidentally dropped the code into the X theme proper, so that’s gone and I was able to easily sort that out. However, nothing I put into the designated area in the code (images, text, what have you) will populate on the pages. Do I need to wrap it in some kind of shell for the PHP to recognize it, or am I doing something wrong?

    #40262
    Rad
    Moderator

    Hi Jameson,

    Sorry, but I’m not sure what you meant. :/ Could you provide a URL address? Or maybe screenshot too.

    Thank you.

    #40400
    Jameson
    Participant
    This reply has been marked as private.
    #40505
    Rad
    Moderator

    Hi Jameson,

    What fixes did you add? Right now I can’t tell what is wrong.

    If you’re having function name conflict, you could just rename the function you added at child theme’s functions.php

    Example :

    add_action('woocommerce_before_main_content','my_renamed_function');
    
    function my_renamed_function() { ?>
      <!--your banner here-->
    <?php
    }
    

    Thank you.

    #40955
    Jameson
    Participant

    Hi Support,

    The only fix that I applied was to remove the duplicate code on the original X theme. This is all that I have in regards to the proposed fix to allow me to populate content above the automatically-generated content of the store and sidebar.

    Here’s the screenshot I forgot to include.

    Screenshot of functions.php

    #41193
    Alexander
    Keymaster

    Hi Jameson,

    Yes, the problem was that you had the code in both the parent and child theme. Using a child theme allows you to avoid modifying the parent theme. This way things are more “update proof” and your own code is preserved on theme updates.

    Now you just need to replace <!--your banner here --> with whatever HTML you want.

    #42901
    Jameson
    Participant

    Hi Support,

    As I said above,
    However, nothing I put into the designated area in the code (images, text, what have you) will populate on the pages. Do I need to wrap it in some kind of shell for the PHP to recognize it, or am I doing something wrong?

    In the screenshot, the placeholder text is there, but the problem is that -nothing- put into the field shows up.

    #42902
    Jameson
    Participant

    ExampleHere is an example of what I mean. This, as a dummy url (although I’m sure http://www.pants.com is a thing) does not generate any changes to the shop.

    #43262
    Rad
    Moderator

    Hi Jameson,

    That link you provided is a park page, could you post a correct one? or maybe point your domain there 🙂

    Thank you.

    #43656
    Jameson
    Participant

    I checked it on a few browsers, and it always goes straight to the shop.

  • <script> jQuery(function($){ $("#no-reply-38250 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>