خرید بک لینک

Vote count: 0

I need to add a unique CSS style to the articles and single pages sidebar on my site to diferenciate from the home page. The sidebar already has a style called ".sidebar" and it works when I change it, but it affects all the site sidebars.

I've been looking at the sidebars.php file and see there are "if" lines for home or single pages, but don't know what to change. Keep in mind I'm not a programmer.

The code I think should be modified is (sidebar.php):

<aside class="sidebar">
<?php
    wp_reset_query();
    if ( is_home() ){

        $sidebar_home = tie_get_option( 'sidebar_home' );
        if( $sidebar_home )
            dynamic_sidebar ( sanitize_title( $sidebar_home ) ); 

        else dynamic_sidebar( 'primary-widget-area' );  

    }elseif( is_page() ){
        global $get_meta;
        $tie_sidebar_pos = $get_meta["tie_sidebar_pos"][0];

        if( $tie_sidebar_pos != 'full' ){
            $tie_sidebar_post = sanitize_title($get_meta["tie_sidebar_post"][0]);
            $sidebar_page = tie_get_option( 'sidebar_page' );
            if( $tie_sidebar_post )
                dynamic_sidebar($tie_sidebar_post);

            elseif( $sidebar_page )
                dynamic_sidebar ( sanitize_title( $sidebar_page ) ); 

            else dynamic_sidebar( 'primary-widget-area' );
        }

    }elseif ( is_single() ){
        global $get_meta;
        $tie_sidebar_pos = $get_meta["tie_sidebar_pos"][0];

        if( $tie_sidebar_pos != 'full' ){
            $tie_sidebar_post = sanitize_title($get_meta["tie_sidebar_post"][0]);
            $sidebar_post = tie_get_option( 'sidebar_post' );
            if( $tie_sidebar_post )
                dynamic_sidebar($tie_sidebar_post);

            elseif( $sidebar_post )
                dynamic_sidebar ( sanitize_title( $sidebar_post ) ); 

            else dynamic_sidebar( 'primary-widget-area' );
        }

    }elseif ( is_category() ){

        $category_id = get_query_var('cat') ;
        $cat_sidebar = tie_get_option( 'sidebar_cat_'.$category_id ) ;
        $sidebar_archive = tie_get_option( 'sidebar_archive' );

        if( $cat_sidebar )
            dynamic_sidebar ( sanitize_title( $cat_sidebar ) ); 

        elseif( $sidebar_archive )
            dynamic_sidebar ( sanitize_title( $sidebar_archive ) );

        else dynamic_sidebar( 'primary-widget-area' );

    }else{
        $sidebar_archive = tie_get_option( 'sidebar_archive' );
        if( $sidebar_archive ){
            dynamic_sidebar ( sanitize_title( $sidebar_archive ) );
        }
        else dynamic_sidebar( 'primary-widget-area' );
    }
?>
</aside>

Thanks in advance for any help solving this.

asked 57 secs ago

برچسب: نویسنده: استخدام کار تاريخ: پنجشنبه 17 تير 1395 ساعت: 3:39

صفحه بندی