Support » Theme: Customizr » Customizing the functions.php for featured pages just not working

  • Resolved glitterpoprock

    (@glitterpoprock)


    I have created a child theme and activated it, I put in the follwoing codes, my extra sidebar works, but I just cant customize the featured pages at all

    add_filter('tc_fp_link_url' , 'my_custom_fp_links', 10 ,2);
    function my_custom_fp_links( $original_link , $fp_id ) {
    
        //assigns a custom link by page id
        $custom_link = array(
            //page id => 'Custom link'
            8 => 'http://www.bloodeagle.net/?page_id=8',
            5 => 'http://www.bloodeagle.net/?cat=5',
            0 => 'http://www.bloodeagle.net/forum/?page_id=0'
        );
    
        foreach ($custom_link as $page_id => $link) {
            if ( get_permalink($page_id) == $original_link )
                return $link;
        }
    
       //if no custom title is defined for the current page id, return original
        return $original_link;
    }
    
    // Adds a widget area.
    if (function_exists('register_sidebar')) {
        register_sidebar(array(
        'name' => 'Extra Header Widget Area',
        'id' => 'extra-widget-area',
        'description' => 'Extra widget area after the header',
        'before_widget' => '<div class="widget my-extra-widget">',
        'after_widget' => '</div>',
        'before_title' => '<h2>',
        'after_title' => '</h2>'
        ));
    }
    
    // Place the widget area after the header
    add_action ('__after_header', 'add_my_widget_area', 0);
    function add_my_widget_area() {
        if (function_exists('dynamic_sidebar')) {
        dynamic_sidebar('Extra Header Widget Area');
        }
Viewing 3 replies - 1 through 3 (of 3 total)
  • I think (but I’m not at my desk and cannot check) that the numbers (8, 5, and 0 in your case) need to correspond to the featured pages you originally set through the “normal” route, in Appearance > Customize.

    (and p.s. there’s a missing final curly bracket in the code you posted—but I presume that’s just a cut/paste error)

    just figured it out and created fake pages… Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Customizing the functions.php for featured pages just not working’ is closed to new replies.