Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: logo URL #5934
    William Cole
    Participant

    The new version of Simple Catch Pro (2.0) added an if statement in “simplecatch_functions.php”

    344 if ( ! function_exists( ‘simplecatch_headerdetails’ ) ) :

     

    This has made modification of this function so much easier as I can include it in functions.php of my child theme and it replaces the the code enclosed in the above if statement.

    Thanks

    some day I’ll figure out hooks and filters but not today.

    Cheers Bill

    in reply to: logo URL #5623
    William Cole
    Participant

    Thank-you Sakin

    It worked!  Just had to give the function file name in the child theme something other than functions.php ( which yielded white screen of nothing)

    xout-functions.php

    with this inside

    <?php

    /**

    * Simple Catch Pro child functions and definitions

    *

    * unhook functions and replace headerinfo function

    * I think

    *

     

    */

     

     

    /**

    * Set the content width based on the theme’s design and stylesheet.

    */

    // Unhook default Simple Catch Pro functions

    function unhook_simplecatch_functions() {

    // Don’t forget the position number if the original function has one

    remove_action( ‘simplecatch_before_sidebartop’, ‘simplecatch_headerdetails’, 10 );

    }

    add_action( ‘init’, ‘unhook_simplecatch_functions’ );

    add_action( ‘simplecatch_before_sidebartop’, ‘simplecatch_headerdetails_child’, 10 );

    &nbsp;

     

     

    /**

    * Diplaying Header Logo, Site Title and Tagline

    */

    function simplecatch_headerdetails_child() {

     

    //delete_transient( ‘simplecatch_headerdetails’ );

     

    global $simplecatch_options_settings;

    $options = $simplecatch_options_settings;

     

    if ( ( !$simplecatch_headerdetails = get_transient( ‘simplecatch_headerdetails’ ) ) && ( empty( $options[ ‘remove_header_logo’ ] ) || empty( $options[ ‘remove_site_title’ ] ) || empty( $options[ ‘remove_site_description’ ] ) ) ) {

    echo ‘<!– refreshing cache –>’;

     

    $simplecatch_headerdetails = ‘<hgroup class=”logo-wrap clearfix”>’;

     

    if( empty( $options[ ‘remove_header_logo’ ] ) ) {

     

    $simplecatch_headerdetails .= ‘<h1 id=”site-logo”>’.'<a href=”‘.’http://www.utoronto.ca/home.htm&#8217;.'” title=”‘.esc_attr( get_bloginfo( ‘name’, ‘display’ ) ).'”>’;

    if ( !empty( $options[ ‘featured_logo_header’ ] ) ):

    $simplecatch_headerdetails .= ‘<img src=”‘.esc_url( $options[‘featured_logo_header’] ).'” alt=”‘.get_bloginfo( ‘name’ ).'” />’;

    else:

    // if empty featured_logo_header on theme options, display default logo

    $simplecatch_headerdetails .='<img src=”‘. get_template_directory_uri().’/images/logo.png” alt=”logo” />’;

    endif;

    $simplecatch_headerdetails .= ‘</a></h1>’;

    }

     

    if ( empty( $options[ ‘remove_site_title’ ] ) || empty( $options[ ‘remove_site_description’ ] ) ) {

     

    $simplecatch_headerdetails .= ‘<div id=”site-details”>’;

     

    if( empty( $options[ ‘remove_site_title’ ] ) ) {

    $simplecatch_headerdetails .= ‘<h1 id=”site-title”><span><a href=”‘.esc_url( home_url( ‘/’ ) ).'” title=”‘.esc_attr( get_bloginfo( ‘name’, ‘display’ ) ).'”>’.esc_attr( get_bloginfo( ‘name’, ‘display’ ) ).'</a></span></h1>’;

    }

    if( empty( $options[ ‘remove_site_description’ ] ) ) {

    $simplecatch_headerdetails .= ‘<h2 id=”site-description”>’.esc_attr( get_bloginfo( ‘description’ ) ).'</h2>’;

    }

    $simplecatch_headerdetails .= ‘</div>’;

    }

     

    $simplecatch_headerdetails .= ‘</hgroup>’;

     

    set_transient( ‘simplecatch_headerdetails’, $simplecatch_headerdetails, 86940 );

    }

    echo $simplecatch_headerdetails;

    } // simplecatch_headerdetails

    add_action( ‘simplecatch_before_sidebartop’, ‘simplecatch_headerdetails’, 10 );

    }

     

     

     

     

    ?>

     

Viewing 2 posts - 1 through 2 (of 2 total)