Results 1 to 3 of 3

Thread: Override cp_header from Child Theme

  1. #1
    Thread Starter
    cheltenhammedia's Avatar
    Join Date
    Jun 2013
    Location
    Cheltenham
    Posts
    11
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Override cp_header from Child Theme

    Hi everyone,

    We have been trying to override the classipress header with a custom one via the Theme Functions in a child theme.

    Here is what we have done so far:
    We have added the unhook command

    PHP Code:
    // Unhook default ClassiPress functions
    function unhook_classipress_functions() {
      
    remove_action'appthemes_header''cp_header' );
      
    remove_action'appthemes_before_post_title''cp_ad_loop_price' ); 
    Then we have added the custom header and called the hook into action.
    PHP Code:
    // overwrite the main header
    function pa_header() {
    ?>

    <div class="header">

            <div class="header_top">

                    <div class="header_top_res">

                            <p>
                                    <?php echo cp_login_head(); ?>

                                    <a href="<?php echo appthemes_get_feed_url(); ?>" class="srvicon rss-icon" target="_blank" title="<?php _e'RSS Feed'APP_TD ); ?>"><?php _e'RSS Feed'APP_TD ); ?></a>

                                    <?php if ( $cp_options->facebook_id ) { ?>
                                        &nbsp;|&nbsp;<a href="<?php echo appthemes_make_fb_profile_url$cp_options->facebook_id ); ?>" class="srvicon facebook-icon" target="_blank" title="<?php _e'Facebook'APP_TD ); ?>"><?php _e'Facebook'APP_TD ); ?></a>
                                    <?php ?>

                                    <?php if ( $cp_options->twitter_username ) { ?>
                                        &nbsp;|&nbsp;<a href="http://twitter.com/<?php echo $cp_options->twitter_username?>" class="srvicon twitter-icon" target="_blank" title="<?php _e'Twitter'APP_TD ); ?>"><?php _e'Twitter'APP_TD ); ?></a>
                                    <?php ?>
                            </p>

                    </div><!-- /header_top_res -->

            </div><!-- /header_top -->


            <div class="header_main">

                    <div class="header_main_bg">

                            <div class="header_main_res">

                                    <div id="logo">

                                            <?php if ( $cp_options->use_logo ) { ?>

                                                    <?php if ( $cp_options->logo ) { ?>
                                                            <a href="<?php echo home_url('/'); ?>"><img src="<?php echo $cp_options->logo?>" alt="<?php bloginfo('name'); ?>" class="header-logo" /></a>
                                                    <?php } else { ?>
                                                            <a href="<?php echo home_url('/'); ?>"><div class="cp_logo"></div></a>
                                                    <?php ?>

                                            <?php } else { ?>

                                                    <h1><a href="<?php echo home_url('/'); ?>"><?php bloginfo('name'); ?></a></h1>
                                                    <div class="description"><?php bloginfo('description'); ?></div>

                                            <?php ?>

                                    </div><!-- /logo -->

                                    <div class="adblock">
                                        <?php appthemes_advertise_header(); ?>
                                    </div><!-- /adblock -->

                                    <div class="clr"></div>

                            </div><!-- /header_main_res -->

                    </div><!-- /header_main_bg -->

            </div><!-- /header_main -->


            <div class="header_menu">

                    <div class="header_menu_res">

                    <?php wp_nav_menu( array( 'theme_location' => 'primary''menu_id' => 'menu-header''fallback_cb' => false'container' => false ) ); ?>

                    <a href="http://www.gloshorseriders.co.uk/pricing/" class="obtn btn_orange"><?php _e'Post an Ad'APP_TD ); ?></a>
                      
                      <a href="http://www.gloshorseriders.co.uk/pricing" class="obtn btn_orange"><?php _e'test'APP_TD ); ?></a>

                    <div class="clr"></div>

        
                    </div><!-- /header_menu_res -->

            </div><!-- /header_menu -->

    </div><!-- /header -->
    <?php
    }

    // hook into the correct action
    add_action('appthemes_header''pa_header');
    But for some reason the cp_header is not being unhooked.

    We have referenced Samcy previous post on this http://forums.appthemes.com/classipr...ng-here-30954/

    Where are we going wrong here?

  2. #2
    samcy's Avatar
    Join Date
    Mar 2012
    Location
    Germany
    Posts
    12,098
    Thanks
    121
    Thanked 1,756 Times in 1,442 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Rolf Hassel (Samcy)

  3. #3
    Thread Starter
    cheltenhammedia's Avatar
    Join Date
    Jun 2013
    Location
    Cheltenham
    Posts
    11
    Thanks
    6
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] CSS child theme override problem
    By cheltenhammedia in forum ClassiPress General Discussion
    Replies: 5
    Last Post: October 24th, 2013, 10:15 AM
  2. Override child theme-sidebars.php
    By tinnojr in forum ClassiPress General Discussion
    Replies: 1
    Last Post: August 21st, 2013, 02:54 AM
  3. Using child theme to change backgrounds. Can't override blue.css
    By thomson1833 in forum Report ClassiPress Bugs
    Replies: 3
    Last Post: November 8th, 2012, 01:15 PM
  4. child themes css override
    By binh in forum Report ClassiPress Bugs
    Replies: 3
    Last Post: May 22nd, 2012, 04:31 AM
  5. [SOLVED] Child Theme: override the variables
    By einstein in forum ClassiPress General Discussion
    Replies: 3
    Last Post: March 25th, 2012, 04:04 PM