Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #83433
    Mark Argentino
    Participant

    Hello,

    I have recently purchased Catch Box Pro and like the extra options.

    Some things have changed in the Pro version that I cannot duplicate from the Catch Box with a Child theme I was previously using.

    I have 4 questions.

    1. I was using the function [date] to display todays date, it would return for example, Friday, January 22, 2016 – what is the new shortcode to display today’s date.

    2. in my site-description I edited the functions.php file to include the following code so that the description Tagline would be appended with a link to an email link, the code that I put in the functions file was:

    <h2 id=”site-description”><?php bloginfo( ‘description’ ); ?>

    ” title=”<?php esc_attr_e( ‘Send me an email’, ‘catchbox’ ); ?>” rel=”generator”><?php printf( __( ‘Send me an email %s’, ‘catchbox’ ), ‘[email protected]’ ); ?></h2>

    there is no id with the word site-description in the new functions.php file for Catch Box Pro, can you tell me where I can add the email link in the functions.php file or which file do I edit to add this email link?

    3. in my previous theme, I left justified the menu in mobile mode by adding code to the custom css file that Sakin provided, can you tell me the code necessary to left justify the menu when it shows in the mobile menu mode. This was the code that Sakin gave me at the time:

    /* this was to align the header logo, menu and footer left Dec 11 2015*/

    @media
    screen and (max-width: 767px) {
    .logo-wrap {
    float: left;
    text-align: left;
    }
    .one-menu #mobile-header-left-menu {
    float: left;
    }
    .one-menu .menu-access-wrap,
    #colophon .menu-access-wrap,
    #site-generator .copyright,
    #site-generator .powered {
    text-align: left;
    }
    }

    4. in my previous catch box child theme I had put the “Recommend this on Google” link in the footer section, again inserted the code into the functions.php file, but now I don’t know where or how to add the code. The code I used was:

    <div class=”g-plusone” data-annotation=”inline” data-width=”300″></div><!– Place this tag after the last +1 button tag. –>

    <script type=”text/javascript”>

    (function() {

    var po = document.createElement(‘script’); po.type = ‘text/javascript’; po.async = true;

    po.src = ‘https://apis.google.com/js/platform.js&#8217;;

    var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(po, s);

    })();

    </script>

    <!– End of +1 button script for mississauga4sale.com –>

    Thanks for all your help!
    Mark

    #83455
    Mahesh
    Keymaster

    Hi @Mark Argentin,

    If you want to change any functions or codes do not change the theme’s core files. You’ll lose it all with theme updates. It is highly recommended to use the child theme for the theme modifications. You can find more details on how to create child theme HERE.

    1. The shortcode [date] is same for both the theme, but as you are using index.html as a page, the shortcode won’t work.

    2. In Catch Box Pro, catchbox_header_details function is moved to catch-box-pro/inc/custom-header.php. It recommended not to change the code here directly, first create a child theme then in functions.php copy the function, then modify it there.

    3. For justification, CSS provided Sakin previously will work as before. Go to “Dashboard=> Appearance=> Theme Options=> Custom CSS” box and add the CSS.

    4. For “Recommend this on Google” link, you can no do it with the theme without touching the code. Please follow along.
    Go to “Dashboard=> Appearance=> Theme Options=> Footer Editor Options” and add the following HTML at the very end.

    <div class="gplus-holder">
    <div class="g-plusone" data-annotation="inline" data-width="300"></div>
    </div>

    Then Go to “Dashboard=> Appearance=> Theme Options=> Web Master Tools=> Header and Footer codes=> Code to display on Footer” and add the following scripts.

    <script type="text/javascript">
    (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/platform.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
    })();
    </script>

    And lastly, go to “Dashboard=> Appearance=> Theme Options=> Custom CSS” box and add the following CSS:

    .gplus-holder {
        width: 100px;
    }

    Regards,
    Mahesh

    #83543
    Mark Argentino
    Participant

    Hello Mahesh,

    I was able to create the child theme for catch box pro and upload the required files with the changes you outlined above using the zip file and automatically loading the catch box pro child theme.

    Referring to point 2 above, I made changes to the custom custom-header.php and uploaded to the catch-box-pro-child/inc/ folder the changes do not appear online. I’ve had to modify the catch-box-pro/inc/custom-header.php file itself to make the header site-title and site-description modified the way I want it, can you see where there is a problem and why the catch-box-pro-child/inc/custom-header.php file does not show the changes as it should?

    All the other changes that you suggested above worked fine.

    (Aside, point 1, for some reason the index.htm page is now working fine, this was after using a plugin called Redirection, I enabled the redirect, then wordpress created the index.htm page fine, then I disabled the redirect and the index.htm file contines to be created by wordpress as before! Not sure why it’s working fine now)

    Thank you again for such great support!
    Mark

    #83644
    Mark Argentino
    Participant

    Hi Mahesh,

    Once again referring to Point 2 above, I followed your instructions as indicated on this page, http://catchthemes.com/blog/create-child-theme-wordpress/ , and followed exactly as per what you say on this page

    “to override the template files, open the original template file from our original/parent theme and save a copy to the child theme folder with same file name and folder structure. Basically, the file structure has to match with the parent theme.”

    so I created a sub folder called catch-box-pro-child/inc with the file custom-header.php in this folder and made some custom changes and they do not appear on my site.

    Then, I took the code for the ‘catchbox_header_details’ in full and added to the catch-box-pro-child/functions.php file and the custom modifications showed up!

    Does this mean that your instructions at http://catchthemes.com/blog/create-child-theme-wordpress/ need to be changed or is there something else that is not causing my custom modification in the catch-box-pro-child/inc/custom-header.php to show properly?

    Thank you,
    Mark

    #83656
    Mahesh
    Keymaster

    Hi @Mark Argentino,

    It is not necessay to follow the theme structure in child theme. Please remove the inc folder from child theme’s folder. Add the following code in child theme’s functions.php.

    function catchbox_header_details() { 
    
    	// Check to see if the header image has been removed
    	global $_wp_default_headers;
    	$header_image = get_header_image();
    	if ( ! empty( $header_image ) ) : 
         	echo '<div id="hgroup" class="site-details with-logo">';
    	else :
        	echo '<div id="hgroup" class="site-details">';     
    	endif; // end check for removed header image  ?>
     
       		<h1 id="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
           	<h2 id="site-description"><?php bloginfo( 'description' ); ?></h2>
       	</div><!-- #hgroup --> 
    
    <?php
    }

    And then modify the “site-description” as desired. The modification here will override the parent theme’s function and you can see the changes in the frontend.

    Let me know if any problems.

    Regards,
    Mahesh

    #83724
    Mark Argentino
    Participant

    Hello Mahesh,

    I’ve deleted the inc folder and made the changes to the child theme functions.php file as you have indicated above and all is working fine.]

    Thank you again for such great support and theme.

    Mark

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Today's Date Function and header and footer code’ is closed to new replies.