Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #111512
    Roland
    Participant

    Hi

    Is not possible to change some code so that the Featured Content boxes are located below rather than above front page text?

    Thanks

    #111522
    Mahesh
    Participant

    @rolandallen: For that you’ll need to create a child theme and use add_action on another hooks. You can find more details on creating child theme HERE.

    Regards,
    Mahesh

    #111533
    Roland
    Participant

    Hi Mahesh,

    I am indeed using a Child Theme – can you advise the code I would need to move the page text above the Featured Content?

    Many thanks

    #111535
    Roland
    Participant

    Hi Mahesh,

    I just found a possible solution to this from Sakin, posted on January 29th, 2015 where he gives the following code:

    <?php
    // Removing the Default Action Hook
    function unhook_catchkathmandu_functions() {
    	remove_action( 'catchkathmandu_before_main', 'catchkathmandu_homepage_featured_position', 10 );
    }
    add_action( 'init', 'unhook_catchkathmandu_functions' );
    
    add_action( 'catchkathmandu_content_sidebar_start', 'catchkathmandu_homepage_featured_display', 15 );

    It doesn’t seem to work – any suggestions?

    Many thanks

    #111607
    Mahesh
    Participant

    @rolandallen: Add the following code in you child theme’s functions.php.

    /**
     * Loading Parent theme stylesheet
     *
     */
    add_action( 'wp_enqueue_scripts', 'catchkathmandu_child_enqueue_styles' );
    function catchkathmandu_child_enqueue_styles() {
        wp_enqueue_style( 'catchkathmandu-parent-style', get_template_directory_uri() . '/style.css' );
    }
    
    function catchkathmandu_child_featured_content_below_main(){
    	remove_action( 'catchkathmandu_main', 'catchkathmandu_homepage_featured_display', 10 );
    	remove_action( 'catchkathmandu_after_secondary', 'catchkathmandu_homepage_featured_display', 10 );
    	remove_action( 'catchkathmandu_before_main', 'catchkathmandu_homepage_featured_position', 10 );
    	add_action( 'catchkathmandu_content_after_content', 'catchkathmandu_homepage_featured_display', 10 );
    }
    add_action('init', 'catchkathmandu_child_featured_content_below_main');

    Then create footer.php file in your child theme and add the following codes:

    <?php
    /**
     * The template for displaying the footer.
     *
     * Contains the closing of the id=main div and all content after
     *
     * @package Catch Themes
     * @subpackage Catch Kathmandu
     * @since Catch Kathmandu 1.0
     */
    ?>
    
    	<?php 
        /** 
         * catchkathmandu_content_sidebar_end hook
         *
         * @hooked catchkathmandu_content_sidebar_wrap_end - 10
    	 * @hooked catchkathmandu_third_sidebar - 15
         */
        do_action( 'catchkathmandu_content_sidebar_end' ); 
        ?> 
        <div style="clear: both;"></div>
        <?php do_action( 'catchkathmandu_content_after_content' );  ?> 
    
    	</div><!-- #main .site-main -->
        
    	<?php 
        /** 
         * catchkathmandu_after_main hook
         */
        do_action( 'catchkathmandu_after_main' ); 
        ?> 
        
    	<footer id="colophon" role="contentinfo">
    		<?php
            /** 
             * catchkathmandu_before_footer_sidebar hook
             */
            do_action( 'catchkathmandu_before_footer_sidebar' );    
    
    		/* A sidebar in the footer? Yep. You can can customize
    		 * your footer with three columns of widgets.
    		 */
    		get_sidebar( 'footer' ); 
    
    		/** 
    		 * catchkathmandu_after_footer_sidebar hook
    		 */
    		do_action( 'catchkathmandu_after_footer_sidebar' ); ?>   
               
            <div id="site-generator" class="container">
    			<?php 
                /** 
                 * catchkathmandu_before_site_info hook
                 */
                do_action( 'catchkathmandu_before_site_info' ); ?>  
                        
            	<div class="site-info">
                	<?php 
    				/** 
    				 * catchkathmandu_site_info hook
    				 *
    				 * @hooked catchkathmandu_footer_content - 10
    				 */
    				do_action( 'catchkathmandu_site_generator' ); ?> 
              	</div><!-- .site-info -->
                
    			<?php 
                /** 
                 * catchkathmandu_after_site_info hook
                 */
                do_action( 'catchkathmandu_after_site_info' ); ?>              
           	</div><!-- #site-generator --> 
            
            <?php
            /** 
    		 * catchkathmandu_after_site_generator hook
    		 */
    		do_action( 'catchkathmandu_after_site_generator' ); ?>  
                   
    	</footer><!-- #colophon .site-footer -->
        
        <?php 
        /** 
         * catchkathmandu_after_footer hook
    	 *
         * @hooked catchkathmandu_scrollup - 10
         */
        do_action( 'catchkathmandu_after_footer' ); 
        ?> 
        
    </div><!-- #page .hfeed .site -->
    
    <?php 
    /** 
     * catchkathmandu_after hook
     */
    do_action( 'catchkathmandu_after' );
    
    wp_footer(); ?>
    
    </body>
    </html>

    Regards,
    Mahesh

    #111608
    Roland
    Participant

    Hi Mahesh,

    Many thanks for going to so much trouble to produce this code – unfortunately it doesn’t appear to work? I’ve added the top section of code into the child theme style.css and created a blank footer.php into which I’ve pasted the larger section of code – I’m sure it’s something I’m doing wrong?

    Kind regards,

    Roland

    #111610
    Roland
    Participant

    Apologies – I’ve just re-read this and seen that I need to add the top piece of code into functions.php, not style.css…

    I’ll try again!

    #111611
    Roland
    Participant

    Hi Mahesh,

    It now works perfectly!

    Many thanks indeed.

    Kind regards,

    Roland

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Featured Content below page text’ is closed to new replies.