Loading...

Documentation Theme

bootScore Child

The child-theme serves as a foundation for customizing bootScore without making changes to the code of the parent-theme. By editing this theme, you can update bootScore without the risk of losing your modifications.

bootScore Child is not a standalone theme, it require bootScore to be installed.

Installation

  1. Download the zip file here.
  2. In your admin panel, go to Appearance > Themes and click the Add New button.
  3. Click Upload Theme and Choose File, then select the theme’s .zip file. Click Install Now.
  4. Click Activate to use your new theme right away.

How to use

Templates

Template files can be overridden by storing a copy in the child theme. It is important to maintain the same folder structure as in the bootScore main theme. Some examples:

  • Place a copy of header.php in the child theme and modify the bg-body-tertiary class to bg-danger. This change will make the navbar red. Repeat the same process for footer.php to achieve the desired modifications.
  • Create a folder named “page-templates” within your child theme. Copy the page template that needs to be edited from the parent theme into this folder. Make the desired modifications to the template as per your requirements.

Functions

Most of the functions in the parent theme are pluggable, allowing them to be overridden in the child’s functions.php. Read here for more information.

SCSS

Add your CSS or SCSS code to the file named scss/_bscore_custom.scss. Ensure that you include any necessary modifications to Bootstrap variables in the file scss/_bscore_variables.scss. The SCSS compiler will fetch the source files from the parent theme and compile them into your child css/main.css whenever a change is made. Read here for more information.

WooCommerce

Starting from bootScore 5.3.0, all required scripts are disabled by default and are enabled only if WooCommerce is installed, with the exception of the SCSS files.

If WooCommerce is NOT being used, it is advisable to disable the styles specific to it for the sake of performance. In the child theme, there is a file named scss/main.scss which fetches all the source files from the parent theme. In line 5 you will find this:

@import "bscore_woocommerce";

Comment or delete this line.

JavaScript

Custom JavaScript can be added to the js/custom.js file. If you intend to use jQuery, ensure that your code is wrapped inside the jQuery(function ($) {}); wrapper. This ensures that your code executes only after jQuery has been loaded.

92 Comments on “bootScore Child”

  • Daniel Munoz Rey

    says:

    As I don’t know how to build my Bootstrap 5 in the builder (this one is only for version 4: https://bootstrap.build/app) for now I am going to use the parent CSS and not my child by commenting these 3 lines in my enqueues:

    //wp_dequeue_style(‘bootstrap’);
    //wp_deregister_style(‘bootstrap’);
    //wp_enqueue_style(‘child-theme-bootstrap’, get_stylesheet_directory_uri() .’/css/bootstrap.min.css’);

    • Basti

      says:

      Hello Daniel,

      correct. There is no bootstrap.min.css generator for Bootstrap 5 out there yet. Think first one will come in next two months.

      So, you can customize your own with Sass https://getbootstrap.com/docs/5.0/customize/sass/, or place a copy of the bootstrap.min.css in your child theme, unminify it and customize it via CSS.

      I know this is very unwieldy, but Bootstrap 5 is new, new, new.

      • Daniel Munoz Rey

        says:

        Thank you Basti.

        I do not like SASS or CSS pre-processors, so meanwhile I did this in my local CSS for my link colours:

        /* BOOTSTRAP BUILD */
        :root {–bs-primary:#f300ff;}

        /* LINK COLOURS */
        a {color:var(–bs-primary);}
        a:hover {color:#fff;}
        a:hover img {opacity:0.6; filter:alpha(opacity=60);}
        .btn-primary {background-color:var(–bs-primary); border-color:var(–bs-primary);}
        .btn-primary:hover {background-color:var(–bs-primary); border-color:var(–bs-primary); opacity:0.6; filter:alpha(opacity=60);}

        Daniel.

  • Daniel Munoz Rey

    says:

    For now I would like to change only the link colour so, can I add this to my local CSS:

    :root {–bs-primary: #f300ff;}

    • Basti

      says:

      That will not work, because primary-color is written as HEX in bootstrap.min.css

      a {
          color: #0d6efd;
      }
      

      You can edit your Bootstrap by replacing all #0d6efd with #f300ff. Then primary color is set to pink.

      • Daniel Munoz Rey

        says:

        It worked for me with this:

        :root {–bs-primary:#f300ff;}
        a {color:var(–bs-primary);}

        Daniel.

      • Basti

        says:

        Good, learned something again.

  • Daniel Munoz Rey

    says:

    I would like to remove offcanvas, I tried yesterday and it worked is only the align that didn’t work (menu on the right when not in mobile) and also the hamburger didn’t have the lovely effect of converting into an X, if you could help that would be great.

    • Basti

      says:

      Offcanvas is default now. In my opinion a top-open navigation is outdated. But of course it is still there. Load bootScore 4 and look to header.php, theme_header.css and theme.js. Now copy step by step.

      I created an rough example with Bootstrap default navbar component, without the widgets and inline CSS / JS. View and download at Github. Replace your child header.php (but keep copy).

      • Daniel Munoz Rey

        says:

        I do not like offcanvas, I think is too invasive and for an average website it takes too much space depending on the device. I used Bootstrap 5 examples page and it works but I cannot align it to the right when not collapsed (desktop). I will see at your code in Github, thank you.

        • Daniel Munoz Rey

          says:

          Thank you for the GitHub code, I used it but I changed the hamburger menu with this:

          
          

          And only used this CSS for the animation (no script):

          /* AREA: Hamburger button */
          .icon-bar {width:22px; height:2px; background-color:#999; display:block; transition:all 0.2s; margin-top:4px;}
          .navbar-toggler {border:none; background:transparent !important; padding-top:0; padding-right:0;}
          .navbar-toggler:focus {outline:none;}
          
          /* AREA: Hamburger button animation */
          .navbar-toggler .top-bar {transform: rotate(45deg); transform-origin: 10% 10%;}
          .navbar-toggler .middle-bar {opacity: 0;}
          .navbar-toggler .bottom-bar {transform: rotate(-45deg); transform-origin: 10% 90%;}
          .navbar-toggler.collapsed .top-bar {transform: rotate(0);}
          .navbar-toggler.collapsed .middle-bar {opacity: 1;}
          .navbar-toggler.collapsed .bottom-bar {transform: rotate(0);}
          

          Still needs a bit of polish but it works!

          Daniel.

          • Daniel Munoz Rey

            says:

            Could not put HTML code here with (pre) (/pre) so here it goes with no tags:

            button class=”navbar-toggler collapsed” type=”button” data-bs-toggle=”collapse” data-bs-target=”#navbarSupportedContent” aria-controls=”navbarSupportedContent” aria-expanded=”false” aria-label=”Toggle navigation”

            span class=”icon-bar top-bar” /span
            span class=”icon-bar middle-bar” /span
            span class=”icon-bar bottom-bar” /span

            /button

  • Daniel Munoz Rey

    says:

    As we are not using favicon in customiser I removed in the child like this, maybe you could add this to parent:

    function dmr_customize_register( $wp_customize ) {
    $wp_customize->remove_control(‘site_icon’);
    }
    add_action( ‘customize_register’, ‘dmr_customize_register’ );

    • Basti

      says:

      It does not work?

      • Daniel Munoz Rey

        says:

        Yes, it works in my child, but I was proposing you to add it in the parent if you want.

  • Daniel Munoz Rey

    says:

    I understand that Bootstrap 5 does not require Jquery, should I dequeue it if I am not using it in my child or do you need it in the parent?… Or maybe is used for plugins, like Contact form 7

    • Basti

      says:

      jQuery is used in theme and plugins. If you dequeue jQuery, nothing will work anymore. Even other plugins like Contact Form 7 or libraries uses jQuery, not only my plugins.

      • Daniel Munoz Rey

        says:

        Ok, I understand, thank you Basti.

        I am obsessed with web performance… so what about Jquery migrate, can we remove it? like this:

        // WordPress’s onboard jQuery to footer (no Migrate):
        wp_deregister_script(‘jquery’);
        wp_enqueue_script(‘jquery’, includes_url(‘/js/jquery/jquery.min.js’), false, null, true);

        Daniel.

      • Basti

        says:

        bootScore and all plugins do not need jQuery migrate, think you can remove it.

        • Daniel Munoz Rey

          says:

          Removed, thank you.

          • Daniel Munoz Rey

            says:

            I just realised that I can remove jQuery migrate but I shouldn’t move jQuery to footer as if any other script needs jQuery then it is loaded late, ie, Dark mode plugin does not work if I do this.

  • Daniel Munoz Rey

    says:

    Can you dequeue this CSS in th parent as it has no contents?

    /wp-content/themes/bootscore-5/style.css

    • Basti

      says:

      No. style.css is a core of a WP theme and needed for meta data. If you dequeue it, theme will not work.

      • Daniel Munoz Rey

        says:

        I have just remove this line in the enqueues in my child to remove that empty file (one less request) and it seems to work:

        //wp_enqueue_style(‘bootscore-parent-style’, get_template_directory_uri() . ‘/style.css’);

        Daniel.

        • Daniel Munoz Rey

          says:

          As I mentioned I am obsessed with web performance, I think is the most important issue after SEO, so for me remove one empty file to get one less request is worthy… I did it and it works, so I am going to leave it like this in my child, but thank you for the info!

  • Daniel Munoz Rey

    says:

    Could you add a hook just after id primary?… I need it to add breadcrumbs to all my pages:

    • Basti

      says:

      I will add it in the next updates

      • Daniel Munoz Rey

        says:

        Thank you!

    • Basti

      says:

      Can I ask what you exactly want to do with this hook?

      • Daniel Munoz Rey

        says:

        At the moment in the parent theme only single-*.php has got breadcrumbs, I think all pages except home page should have breadcrumbs, or not (child can plug nothing into your pluggable breadcrumb function) so I think all pages should have to have one of these options:

        1. Add this to all page templates, not just in single-*.php:

        (the_breadcrumb() is defined in functions.php as pluggable)

        OR

        2. All pages should have a hook:

        (so child themes can add or not breadcrumbs or anything else, this solution is better I think)

        Thank you.

        Daniel.

        • Daniel Munoz Rey

          says:

          The code has been removed in my previous post, can you erase that post I cannot do it myself

          • Daniel Munoz Rey

            says:

            At the moment in the parent theme only single-*.php has got breadcrumbs, I think all pages except home page should have breadcrumbs, or not (child can plug nothing into your pluggable breadcrumb function) so I think all pages should have to have one of these options:

            1. Add this to all page templates, not just in single-*.php:
            After div id=”primary” >>> Add php: the_breadcrumb()
            (the_breadcrumb() is defined in functions.php as pluggable)

            OR

            2. All pages should have a hook:
            After div id=”primary” >>> Add php: do_action( ‘bs_after_primary’ )
            (so child themes can add or not breadcrumbs or anything else, this solution is better I think)

            Thank you.

            Daniel.

      • Basti

        says:

        Ok. At first, WordPress does not support breadcrumbs for pages, only for posts. Thats why only the single-*.php files has a breadcrumb. So, we must do something to WP to support breadcrumb in pages and edit templates.

        1. Add code to functions.php
        2. Add breadcrumb in your page.php
        3. Adjust top margin in page.php

        It is not possible to display PHP code here in comments, so I created a page with breadcrumb and pasted the code there. bootscore.me/page-with-breadcrumb/

        Hope that helps

        • Daniel Munoz Rey

          says:

          In single.php you call a function: the_breadcrumb() which is defined in functions.php

          In this function, in the same way that you define the breadcrumbs only for category and single, you could define it for all the pages.

          But if you want to stick to breacrumbs for only posts I would appreciate if you put a hook after the div id=”primary”, this way we can add in our child theme anything we want including breadcrumbs, otherwise we will have to replicate all your files in the parent which will be risky for future updated of the parent theme.

          Thank you!

          Daniel.

          • Daniel Munoz Rey

            says:

            And regarding your link… thank you!

            That is exactly why we need a hook after div #primary, to add the call to nav_breadcrumb function in that hook, without having to replicate all your pages.

            Daniel.

      • Basti

        says:

        Page and post templates wont get any important updates, they are good as they are. It is the function of a child theme that you edit the templates in a copy from parent theme. That is what a child theme does. You can also create your own templates by renaming for example page-breadcrumb.php in child and select them in the backend.

        This is the proper way to add breadcrumb to pages, I did it this way in client pages as well.

        However, I will provide a hook there. But later in 2nd version after release. It must be tested and I am struggling with some other things at the moment.

      • Basti

        says:

        Hook is there, download the new file in your dashboard.

  • Daniel Munoz Rey

    says:

    Briefly what is the function of each of these file?… Can they be merged?:

    /themes/bootscore-5/js/theme.js
    /themes/bootscore-5/js/theme-header.js

    Thank you.

    • Basti

      says:

      Yes, they can. But in theme-header.js there is script for offcanvas which is temporary. It will be deleted when official Bootstrap offcanvas component is ready. It’s just for me to keep track of things.

      • Daniel Munoz Rey

        says:

        I understand, thank you.

  • Daniel Munoz Rey

    says:

    Do you recommend to remove wp-embed.min.js?… it embeds WordPress posts from other people websites, it’d do it like this:

    wp_deregister_script(‘wp-embed’);

    Thank you.

    • Basti

      says:

      I have no idea

      • Daniel Munoz Rey

        says:

        I removed, one request less… 🙂

  • Daniel Munoz Rey

    says:

    A request could be saved if you add the contents of this small file to another CSS file:

    /themes/bootscore-5/css/theme-preloader.css’

    Thank you.

    • Basti

      says:

      Yes. But it has an own registered CSS in case if you use an optimizing plugin like jch-optimize or Autoptimize. They place all CSS in the footer and you will see an ugly flicker on page load. Because this tiny file is registered, you can deselect it from pushing it to footer by plugin. So CSS of the preloader is still in header and loaded first.

  • Daniel Munoz Rey

    says:

    In case somebody is interested this removes the breakpoints, is still responsive but only fluid not adaptive… I just think that why leave white spaces left and right in some intermedia device scenarios making the need to more scroll…

    /* REMOVE BREAKOINTS */
    .container {width:100%; max-width:1320px;}

    Daniel.

  • Daniel Munoz Rey

    says:

    In the Offcanvas panel, shouldn’t the top left icon “<" be ">” as this would be the action of the panel when you click on it?

    And/or the “Close Menu” be an “X” maybe?…

    And also maybe the hamburger 3 lines is better if they are “>>>”

    I know it is early days but the icons in this page need a rethink… I think… 🙂

    Thank you.

    • Basti

      says:

      The entire Offcanvas header is clickable, not only the icons. It is therefore very easy to close the Offcanvas on mobile phone with the thumb of your left or right hand.

      You can easily swap the icons in your header.php, or insert your own svg icons or CSS animation.

      The theme is as neutral as possible, only Bootstrap and Font Awesome.

      It is your job to create a amazing design of it 😉

      • Daniel Munoz Rey

        says:

        Good point!… 😉

  • piko cillo

    says:

    hi i am using bootcommerce-5 child. I created a home-page.php to customize the home page of the web site. I’m trying to insert a bootstrap carousel (by code) but the slide show doesn’t work. I have not entered any path to call bundle.min.js in the function.php of the bootcommerce-5 theme as it should call it from the function.php file of the bootscore-5 theme which of course I have installed. Also I notice that on the same home page the scroll up button doesn’t work either so I guess it can’t load the functions from the bundle.min.js. What can it depend on? Any advice? Thank you

    • Basti

      says:

      Hey,
      at first glance it seems that there is a conflict with smooth-scroll using an a href="#.." in slideshow. But thats very hard to say without having a link to check the error. So, please share a link to your site. If you do not want to share public, you can sent me the link via the contact form.

  • Bruno Sas

    says:

    Hi!
    Why didn’t you enqueue the child style.css file on the child theme?
    Like this :

    add_action( ‘wp_enqueue_scripts’, ‘bootscore_5_child_enqueue_styles’ );
    function bootscore_5_child_enqueue_styles() {
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );
    wp_enqueue_style( ‘child-style’, get_stylesheet_uri() ); ———————–> I have added this
    }

    For some reason the child style.css that gets loaded on the browser is empty, it only has these descrption:

    /*
    Theme Name: bootScore 5 Child
    Description: bootScore 5 Child Theme
    Author: craftwerk – Bastian Kreiter
    Author URI: https://crftwrk.de
    Template: bootscore-5
    Version: 5.0.0.2
    Text Domain: bootscore
    */

    However, I have some stlyes on the child style.css that are not being loded…
    Any idea what might be wrong?

    • Basti

      says:

      Hi Bruno,

      there was something like yours before, but there was an issue that child style.css was loaded twice. See here https://github.com/craftwerkberlin/bootscore-5-child/issues/2

      I tested it by adding some css to style.css in child and it works fine. However, both child-themes get an update in near future, I have it on the list and will improve it.

      “However, I have some stlyes on the child style.css that are not being loded…
      Any idea what might be wrong?”

      It is hard to say without having a link to your project. Please share a link to your site that I can see what is wrong. If you do not want to share public, you can send me the link via the contact form

      Thank you for reporting

      • Bruno Sas

        says:

        It was my fault. style.css was outside the theme folder.
        Thank you so much!

  • Joe Lambert

    says:

    Hi Basti,

    Loving the theme so far, however I am looking to do some customisations to bootstrap and I understand that bootstrap.build is not yet ready for Bootstrap 5. I am comfortable customising the SASS using this guide https://getbootstrap.com/docs/5.0/customize/sass/. However, given that the theme only uses the bootstrap.min file, how am I supposed to import bootstrap files if they don’t exist in the theme?

    Maybe I am being dumb and it’s just as simple as downloading those files and adding them to the child theme?

    Thanks you

    Thanks,
    Joe

    • Basti

      says:

      Hi Joe,

      the source code is not included in the theme, it use only the compiled bootstrap.min.css. Maybe that’s not clear enough in the article, I will improve it.

      So, you must download https://getbootstrap.com/docs/5.0/getting-started/download/ the source code and customise/compile by yourself. Replace the compiled bootstrap.min.css in theme or use it in child as described above.

      However, this project uses currently Bootstrap 5 Beta2, but Bootstrap has released Beta3 a few days ago. Beta3 has a new offcanvas component https://getbootstrap.com/docs/5.0/components/offcanvas/, which uses almost the same classes as the self coded but different JavaScript. If you want to use Beta3, the Header crashed, because the offcanvas uses same classes.

      I am working on the next update right now which replaces self coded offcanvas by the Bootstrap component, but there are still some bugs in theme and Beta3. Will try to release this week. What I mean with that is, that you need to load the source code from Beta2 if you want to edit current version. But my recommendation is: Wait a couple of days until next bootScore version is released, otherwise you will do your work twice.

      Best regards

      Basti

      • Joe Lambert

        says:

        Hi Basti,

        Thanks for the reply, perfect this makes sense. Definitely no rush on my end, so I’ll wait until you’ve got the update out for bootScore.

        Keep up the great work!

  • Ara Voskan

    says:

    Good day
    How to add a registration form for new visitors?
    Now registration takes place only when purchasing a product.

    • Basti

      says:

      Hello Ara

      go in Backend to WooCommerce > Settings > Accounts and check Enable customer registration on the “My account” page.

  • Ara Voskan

    says:

    Everything is perfectly done!
    The only thing that I lack in a theme without a store is the registration and login form.

    • Basti

      says:

      There is no reason why a user should register or login on your page without having a shop or something other that needs user management. That‘s why WordPress has no login or registration form by default. You must use plugin for that https://wordpress.org/plugins/custom-wp-login/

      • Ara Voskan

        says:

        OK, thanks

  • Ara Voskan

    says:

    Please tell me how you can make sure that the login button in the bootScore 5 Child Theme does not disappear?
    So that when you click open the login form.

    • Basti

      says:

      Do not understand what you mean? bootScore child has no login button.

  • Kuba Kuba

    says:

    Hello. This is a fantastic tool for working with wordpress. however, I have a question. For him the bootstrap.min.css file is loaded at the end after the files /theme/style.css oreaz /themechild/style.css? this forces you to use! important in a child template, which is probably not a good practice?

    • Basti

      says:

      Hi Kuba,

      you’re right. But I think that it is not possible to force child-theme’s style.css load before parent-theme’s bootstrap.min.css, because Bootstrap is not included by default in child-theme.

      To load Bootstrap after style.css in child-theme, you should create and enqueue your own Bootstrap in child https://bootscore.me/documentation/custom-bootstrap-min-css/. This is the best and recommended way to fully customize bootScore anyway.

      If you just want to override bootstrap.min.css via custom css, you can use id’s for selectors to avoid !important rule. For example:

      #masthead .navbar-light .navbar-nav .nav-link {
          color: var(--bs-success);
      }
      

      Does that help?

    • Bryan

      says:

      I think he wants the opposite, Basti: load the child theme CSS after the Bootstrap CSS, so that it takes priority without having to use more specificity or !important.

      Kuba, I had that issue too. You can fix this by dequeuing bootscore-style in your child theme’s functions.php file. Then enqueue it again to change the load order.

      • Kuba Kuba

        says:

        this is what i need for this, could you please provide some code for this?

  • John Doe

    says:

    Hi, I’ve noticed that your child theme is using `@import` which is generally a bad idea: https://www.giftofspeed.com/avoid-using-css-import/

    It’s much better to enqueue custom styles in `function.php` file like so:
    `wp_enqueue_style(“custom-css”, get_stylesheet_directory_uri() . “/css/styles.css”);`
    That’s the “proper” way 😉

    • Basti

      says:

      Hi John,

      “Hi, I’ve noticed that your child theme is using `@import` which is generally a bad idea:”

      That’s true, but:

      1. No need to enqueue a new CSS file in child
      2. @import is just an example how to keep an eye on files through development. When finished copy all to style.css and delete files.
      3. If you use a caching plugin like Autoptimize or W3 Total Cache, all files will be combined to one and you can keep this @import file structure, because only one file is loaded. Please check this blog post https://bootscore.me/blog/theme-blog/new-plugin-new-feature-speed/ about speeding up bootScore.

  • Bernhard Karakoulakis

    says:

    Hi Basti, hi everybody

    @ thanks so much for your theme.
    I have a problem with the child themes. They are working remotely but not on the local installation.
    There just the navbar is displayed and the hamburger button does nothing when clicked.

    Do you have any idea?
    Thanks so much, Bernhard

  • Arie Olivier

    says:

    Hi Basti
    Since upgrading from 5.0.1.11 to 5.1.0.0 I have to add !important to my custom.css in my child theme for .btn-primary, .text-primary, etc. Do you know why that is necessary? Thanks

    • Basti

      says:

      Hi Arie,

      I heard about that from some other users. Not sure, but maybe an idea.

      Since 5.0.2.2 scripts & styles were loaded with dynamic version number by timestrap when file content changed to prevent browser caching when working on the file. But in child style.css that‘s not working. This file takes version number from installed WordPress. That means that Bootstrap is loaded before style.css from child.

      Please go to this file https://github.com/craftwerkberlin/bootscore-5/blob/03bbfbe9ce7ecfd281b63f98bdc146e791e7a19b/functions.php and copy enqueue code from line 243 to 267. Replace snippet in function.php from line 244 to 274 (5.1.0.0).

      Let me know if that helps. If yes, I will change that.

      Basti

      • Arie Olivier

        says:

        Hi Basti
        Yes that seems to work. Thanks!

        • Basti

          says:

          👍 It’s fixed. Load latest version in your dashboard.

          • Arie Olivier

            says:

            Hi Basti. I loaded the new version, but it seems the enqueue code in the functions.php file is the same as in vs 5.1.0.0. The Bootstrap css has preference over my child css again.

            • Basti

              says:

              Hi Arie,

              this was the only thing changed with enqueueing the files. But parent Bootstrap will always load before child style.css if you do not enqueue your own bootstrap.min.css in child.

              So, I can not explain what happen, what changed. Maybe it has something to do with Bootstrap version, I don‘t know.

              However, I would use id for css selectors to avoid !important rule. Something like #masthead .navbar .nav-link…

              I will try to find a way to force load child css first in future.

              • Arie Olivier

                says:

                OK I’ll use the enqueue code from before in the mean time. Thanks

  • celeste

    says:

    Simple suggestion for child-theme.
    In next version, can you add the code to enqueue custom styles.

    Thanks

      • celeste

        says:

        Ok thankshttps://bootscore.me/documentation/using-the-child-themes/#comment-5600

  • JIM POULOS

    says:

    Hi, I have tried to change the “Register” text in both the Bootcommerce5 Child theme and the Bootscore Theme and the change initially shows, and then it disappears. I’m editing the file in my child theme here /woocommerce/myaccount/my-account-offcanvas.php — what am I missing? I’ve worked with child themes for over a decade, but clearly I’m missing something. thanks in advance.

    • JIM POULOS

      says:

      So, what seems to be happening is if I change /woocommerce/myaccount/my-account-offcanvas.php in the Bootscore5 Parent files, the changes take effect, but when I change it in Bootcommerce-5-child-main, nada.

      • Basti

        says:

        Hi Jim,

        yes, my-account-offcanvas.php is an own file and not from WooCommerce. This file cannot be overridden in the same way. It’s linked in the header.php and you must change path there.

        Copy like you did in previous comment file to your child. Then open header.php in child and search for:

        <?php include get_template_directory() . '/woocommerce/myaccount/my-account-offcanvas.php'; ?>
        

        Replace that snippet with this:

        <?php include get_stylesheet_directory() . '/woocommerce/myaccount/my-account-offcanvas.php'; ?>
        

        Now it’s linked to your child file and you can edit as you want.

        But this can be done much more simpler if you just want to replace the “Register” text.

        1. Translate it with loco translate

        or

        2. Replace it with 2 lines of code in child.js:

        // Register title    
        $('#offcanvas-user .register .h2:contains("Register")').text('New title text');
        // Register Button
        $('#offcanvas-user .register .woocommerce-form-register__submit:contains("Register")').text('New button text');
        

        Clear Browser cache.

        Solved?

        Basti

        • JIM POULOS

          says:

          Hi Basti, will work on this today and get back to you. Thank you for the speedy reply.

        • JIM POULOS

          says:

          Solved! Thanks again, really loving this theme. Putting it into the mix as the base for all of our projects with my company.

  • JIM POULOS

    says:

    Pagination: I want all posts to show on archive-faculty-member.php — this isn’t working

    add_action( ‘pre_get_posts’, ‘fm_archive_page’ );
    // Show all Faculty on Faculty Members Archive Page
    function fm_archive_page( $query ) {
    if ( !is_admin() && $query->is_main_query() && is_post_type_archive( ‘faculty-members’ ) ) {
    $query->set( ‘posts_per_page’, ‘-1’ );
    }
    }

    I removed :


    <!–

    –>

    but all that does is remove the pagination itself.

    Where can I change number of posts or turn off pagination?

    • Basti

      says:

      Hi Jim,

      This is set globally. Go in parent’s theme functions.php to line 309, there you will find this:

      // Amount of posts/products in category
      if (!function_exists('wpsites_query')) :
      
        function wpsites_query($query) {
          if ($query->is_archive() && $query->is_main_query() && !is_admin()) {
            $query->set('posts_per_page', 24);
          }
        }
        add_action('pre_get_posts', 'wpsites_query');
      
      endif;
      // Amount of posts/products in category END
      

      Copy this snippet to your child’s functions.php and set amount in line 6 from 24 to how many posts you want to show.

      If you want to disable pagination complete, just leave this function blank:

      // Amount of posts/products in category
      if (!function_exists('wpsites_query')) :
      
          // Empty function, disables pagination
      
      endif;
      // Amount of posts/products in category END
      

      Solved?

Comments are closed.

To top