• cerrmj

    (@cerrmj)


    I want to replace the built-in home page slider on the home page with the “Smart Slider 3” plug-in. When I turn off the built-in slider and put the SS3 shortcode into my home page content, the SS3 slider appears below the “Featured Pages” section.

    I have the ‘classic’ style enabled.

    I Tried the instructions here ( https://presscustomizr.com/snippet/move-featured-pages-block-anywhere-front-page/ ) creating a child theme (Childify Me) and tried the following code to move the featured pages above the footer.

    //we hook the code on the wp_head hook, this way it will be executed before any html rendering.
    add_action ( 'wp_head' , 'move_my_fp');
    function move_my_fp() {
    	//we unhook the featured pages
    	remove_action  ( '__before_main_container', array( TC_featured_pages::$instance , 'tc_fp_block_display'), 10 );
     
    	//we re-hook the block. Check out the priority here : set to 0 to be the first in the list of different actions hooked to this hook 
    	add_action  ( '__after_content', array( TC_featured_pages::$instance , 'tc_fp_block_display'), 0 );
    }

    But I get the error: Fatal error: Class ‘TC_featured_pages’ not found in /home/bobswh5/public_html/asburyunitedmethodist.org/wp-content/themes/customizr_child/functions.php on line 5

    I’m guessing that something has changed in the theme code since the instructions were written. Any thoughts about how to accomplish moving the “Featured Pages” below the page content?

    Thanks in advance.
    BOb.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Denzel Chia

    (@denzel_chia)

    Hi,

    The class name and method name has been changed.

    https://github.com/presscustomizr/customizr/blob/253b5ec4fcec75a5b2f38e76602fbe9f03a3d509/inc/_dev/parts/class-content-featured_pages.php#L15

    https://github.com/presscustomizr/customizr/blob/253b5ec4fcec75a5b2f38e76602fbe9f03a3d509/inc/_dev/parts/class-content-featured_pages.php#L67

    Find two line of the following code

    array( TC_featured_pages::$instance , 'tc_fp_block_display')

    and change to the following.

    array( CZR_featured_pages::$instance , 'czr_fn_fp_block_display')

    Thank you

    Thread Starter cerrmj

    (@cerrmj)

    Denzel,

    I’ve updated the code in my child theme’s functions.php to this:

    remove_action  ( '__before_main_container' , array( CZR_featured_pages::$instance , 'czr_fn_fp_block_display'), 10 );
    add_action  ( '__after_content' , array( CZR_featured_pages::$instance , 'czr_fn_fp_block_display'));

    I’m getting an error now:
    Fatal error: Class ‘CZR_featured_pages’ not found in /home/bobswh5/public_html/asburyunitedmethodist.org/wp-content/themes/customizr_child/functions.php on line 5

    Thanks in advance.
    Bob.

    Denzel Chia

    (@denzel_chia)

    Hi,

    First of all, the hook you are using is wrong.
    I don’t see __after_content hook.
    https://github.com/presscustomizr/customizr/blob/dev/index.php

    As for the fatal error, I am not getting it.

    Please see my screen-cast. I am able to move featured pages to above footer without any fatal error.

    https://screencast-o-matic.com/watch/cbXXfk2oeA

    You may want to hire a developer from https://jobs.wordpress.net if you require further assistance.

    Thank you

    Thread Starter cerrmj

    (@cerrmj)

    Denzel,

    Thanks you so much for the screen-cast – I was able to make the changes you demonstrated and my SS3 slider is now above the Featured Pages and is working perfectly. Thanks so much for you quick responses!

    Here is my fucntions.php file for others that want the code Denzel provided in the screen-cast to move the features pages to below the page content:

    <?php
    /* Write your awesome functions below */
    //we hook the code on the wp_head hook, this way it will be executed before any html rendering.
    add_action ( 'wp_head' , 'move_my_fp');
    function move_my_fp() {
    	//we unhook the featured pages
    	remove_action  ( '__before_main_container', array( CZR_featured_pages::$instance , 'czr_fn_fp_block_display'), 10 );
     
    	//we re-hook the block. Check out the priority here : set to 0 to be the first in the list of different actions hooked to this hook 
    	add_action  ( '__after_article_container', array( CZR_featured_pages::$instance , 'czr_fn_fp_block_display'), 0 );
    }
    /* end of functions */
    ?>
    Denzel Chia

    (@denzel_chia)

    Hi,

    You are welcome. Please kindly mark this topic as resolved.
    Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Move Featured Pages below Page Content’ is closed to new replies.