رفتن به مطلب

ایجاد و کد نویسی 2 خط رنگی


پست های پیشنهاد شده

سلام وقت بخیر

بنده میخواستم بدونم چطور میتونم با کد نویسی مشخص کنم که تا ارتفاع 5 سانتی متری از بالا رنگ پس زمینه قالب سورمه ای باشه و از ان ارتفاع تا یک سانتی متر بعد از ان رنگ طوسی پر رنگ باشه ؟ فقط در صفحه نخست! و فقط کد ن ویسی رنگ را لازم دارم

تشکر و سپاس

Untitled-3.jpg

لینک به ارسال
در 46 دقیقه قبل، amator گفته است :

سلام وقت بخیر

بنده میخواستم بدونم چطور میتونم با کد نویسی مشخص کنم که تا ارتفاع 5 سانتی متری از بالا رنگ پس زمینه قالب سورمه ای باشه و از ان ارتفاع تا یک سانتی متر بعد از ان رنگ طوسی پر رنگ باشه ؟ فقط در صفحه نخست! و فقط کد ن ویسی رنگ را لازم دارم

تشکر و سپاس

Untitled-3.jpg

سلام دوست گرامی

اول باید دو تا دایو درست کنی بعد به هر کدوم رنگ های دلخواهت رو قرار بدی

<div class="one"></div>
<div class="two"></div>
.one{
  height: 200px;
  color:#0877ae
}
.two{
  height: 60px;
  color:#37474f
}

 

ویرایش شده توسط reza_yki
لینک به ارسال
در 49 دقیقه قبل، reza_yki گفته است :

سلام دوست گرامی

اول باید دو تا دایو درست کنی بعد به هر کدوم رنگ های دلخواهت رو قرار بدی


<div class="one"></div>
<div class="two"></div>

.one{
  height: 200px;
  color:#0877ae
}
.two{
  height: 60px;
  color:#37474f
}

 

تشکر متاسفانه با کد نویسی اشنا نیستم این کد ها را هر کدام در چه فایلی قرار بدهم؟

لینک به ارسال
در 2 ساعت قبل، amator گفته است :

تشکر متاسفانه با کد نویسی اشنا نیستم این کد ها را هر کدام در چه فایلی قرار بدهم؟

کد های اول رو در فایل header.php بعد از تگ شروع <body> یا در صفحه index.php قرار بدید

کد های پایین رو در style.css

 

اگر قالبتون استاندارد طراحی شده باشه و بخواین فقط در صفحه اول نشون داده بشه قبل سلکتور ها این کار رو بکنید:

.one , .two{
  display:none;
}
.home .one{
  display:block;
  height: 200px;
  color:#0877ae
}
.home .two{
  display:block;
  height: 60px;
  color:#37474f
}

این راحترین روش هست البته راه های بهتری هم هست ولی به دلیل عدم آشنایی از همین روش استفاده کنید

ویرایش شده توسط reza_yki
لینک به ارسال

متاسفانه عمل نمیکنه! ادرس قالب

index.php

<?php get_header(); ?>
        <div class="main-container clearfix"><!--container-->       
            <div class="main-left"><!--Main Left-->
                <div class="main-content" role="main"><!--Main Content-->
                    <?php
                    	$display = mom_option('hp-display');
                    	$style = mom_option('hp-blog-style');
                    	$post = mom_option('hp-blog-posts');
                        $unique_posts = '';
                        $unique_posts = mom_option('uni_posts');
                    	if($display == 'builder') {
                        	echo apply_filters('the_content', mom_option('home_page_builder'));
                    	} else {
                        	echo do_shortcode('[blog style="'.$style.'" posts_per_page="'.$post.'"]');
                    	}	 
                    ?>                   	                        	
                </div><!--Main Content-->                
                <?php get_sidebar('left'); ?>                
            </div><!--Main left-->               
            <?php get_sidebar(); ?>                                 
        </div><!--container-->
    </div><!--wrap-->   
<?php get_footer(); ?>

header.php

<!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js">
    <head>
        <meta charset="<?php bloginfo( 'charset' ); ?>" />
        <!--[if IE]>
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <![endif]-->

	<link rel="profile" href="http://gmpg.org/xfn/11">
	<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    <title><?php wp_title( '|', true, 'right' ); ?></title>
<?php if (mom_option('mom_og_tags') == 1) { ?>
    <?php if (is_singular()) { ?>
    <meta property="og:image" content="<?php echo esc_url(mom_post_image('medium')); ?>"/>
    <meta property="og:image:width" content="<?php echo get_option( 'medium_size_w' ); ?>" />
    <meta property="og:image:height" content="<?php echo get_option( 'medium_size_h' ); ?>" />

    <?php
        $mom_og_title = get_the_title();
    if (function_exists('is_buddypress') && is_buddypress()) {
        if ( bp_is_user() && !bp_is_register_page() ) {
                $mom_og_title = bp_get_displayed_user_fullname();
        } else {
        $mom_og_title = wp_title('', false);
        }
    }
    ?>

    <meta property="og:title" content="<?php echo esc_attr($mom_og_title); ?>"/>
    <meta property="og:type" content="article"/>
    <meta property="og:description" content="<?php global $post; $excerpt = $post->post_excerpt; if ($excerpt == '') { $excerpt = $post->post_content;} echo esc_attr(wp_html_excerpt(strip_shortcodes($excerpt), 200)); ?>"/>
    <meta property="og:url" content="<?php the_permalink(); ?>"/>
    <meta property="og:site_name" content="<?php echo esc_attr(get_bloginfo( 'name' )); ?>"/>
<?php } else { ?>
    <meta property="og:image" content="<?php echo esc_url(mom_option('logo_img', 'url')); ?>"/>
    <meta property="og:image:width" content="<?php mom_option('logo_img', 'width'); ?>" />
    <meta property="og:image:height" content="<?php mom_option('logo_img', 'height'); ?>" />
<?php } ?>
<?php } ?>

	<?php if(mom_option('enable_responsive') != true) { ?>
	<meta name="viewport" content="user-scalable=yes, minimum-scale=0.25, maximum-scale=3.0" />
	<?php } else {  ?>
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<?php } ?>
    <?php if(mom_option('sharee_print') != 0) { ?>
    <link rel="stylesheet" type="text/css" href="<?php echo MOM_CSS; ?>/print.css" media="print" />
    <?php } ?>
	<?php if ( mom_option('custom_favicon', 'url') != '') { ?>
	<link rel="shortcut icon" href="<?php echo mom_option('custom_favicon', 'url'); ?>" />
	<?php } ?>
	<?php if ( mom_option('apple_touch_icon', 'url') != '') { ?>
	<link rel="apple-touch-icon" href="<?php echo mom_option('apple_touch_icon', 'url'); ?>" />
	<?php } else { ?>
	<link rel="apple-touch-icon" href="<?php echo MOM_URI; ?>/apple-touch-icon-precomposed.png" />
	<?php } ?>
<?php wp_head(); ?>
</head>
    <?php
        if (is_single()) {
            global $post;
            $schema = 'role="article" itemscope="" itemtype="http://schema.org/Article"';
            if (get_post_meta( $post->ID, 'mom_review_post', true ) == 1) {
                $schema = 'itemscope="" itemtype="http://schema.org/Review"';
            }
        } else {
            $schema = 'itemscope="itemscope" itemtype="http://schema.org/WebPage"';
        }
    ?>
    <body <?php body_class(); ?> <?php echo $schema; ?>>
    <?php do_action('mom_first_on_body');
        if (isset($_GET['login']) && $_GET['login'] == 'failed') {
            echo '<div class="alert-bar hide"><p>'.__('Sorry your username or password is incorrect.', 'theme').'</p></div>';
        }
   ?>
    	<!--[if lt IE 7]>
            <p class="browsehappy"><?php _e('You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.', 'theme'); ?></p>
        <![endif]-->
    	<?php if(mom_option('bg_ads') == true) { ?>
        	<a style="height:<?php echo mom_option('bg_ads_h', 'height'); ?>" class="ad_bg" href="<?php echo mom_option('bg_ads_url'); ?>" target="_blank">&nbsp;</a>
        <?php } ?>
        <?php
        $mom_layout = '';
		$theme_layout = mom_option('theme_layout');
		if (is_singular()) {
		    $theme_layout = get_post_meta($post->ID, 'mom_theme_layout', true);
		    if ($theme_layout == '') {
			$theme_layout = mom_option('theme_layout');
		    }
		}
        if($theme_layout == 'boxed') {
            $mom_layout = ' class="fixed_wrap fixed clearfix"';
        } else if($theme_layout == 'boxed2') {
            $mom_layout = ' class="fixed_wrap fixed2 clearfix"';
        } else {
            $mom_layout = ' class="fixed_wrap"';
        }
        ?>
        <div class="wrap_every_thing">
        <div<?php echo $mom_layout; ?>><!--fixed layout-->
            <div class="wrap clearfix"><!--wrap-->
                <header class="header"><!--Header-->
                <div id="header-wrapper"><!-- header wrap -->
                <?php get_template_part('topbanner'); ?>
				<?php if(mom_option('tb_disable')) { get_template_part( 'framework/includes/topbar' );  } ?>

                    <div class="header-wrap"><!--header content-->
                        <div class="inner"><!--inner-->
                        	<?php get_template_part( 'framework/includes/header-content' ); ?>
                        </div><!--inner-->
                    </div><!--header content-->
                </div><!-- header wrap -->

				<?php get_template_part( 'framework/includes/navigation' ); ?>

                <?php if(mom_option('bn_bar')) { get_template_part( 'framework/includes/breaking' ); } ?>

            </header><!--Header-->
             <?php get_template_part('unavbanner'); ?>
            <?php do_action('mom_before_content'); ?>

(style.css)

/*-----------------------------------------------------------------------------------

	Theme Name: مولتی نیوز
	Author: Momizat
	Author URI: http://www.momizat.com
	Version: 2.9.9

	Tags: dark, light, white, black, gray, one-column, two-columns, left-sidebar, right-sidebar, fixed-layout, fluid-layout, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-image-header, featured-images, flexible-header, full-width-template, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready



License:
License URI:

General comments (optional).
-----------------------------------------------------------------------------------------*/

 

 

لینک به ارسال
در 3 دقیقه قبل، amator گفته است :

متاسفانه عمل نمیکنه! ادرس قالب

index.php


<?php get_header(); ?>
        <div class="main-container clearfix"><!--container-->       
            <div class="main-left"><!--Main Left-->
                <div class="main-content" role="main"><!--Main Content-->
                    <?php
                    	$display = mom_option('hp-display');
                    	$style = mom_option('hp-blog-style');
                    	$post = mom_option('hp-blog-posts');
                        $unique_posts = '';
                        $unique_posts = mom_option('uni_posts');
                    	if($display == 'builder') {
                        	echo apply_filters('the_content', mom_option('home_page_builder'));
                    	} else {
                        	echo do_shortcode('[blog style="'.$style.'" posts_per_page="'.$post.'"]');
                    	}	 
                    ?>                   	                        	
                </div><!--Main Content-->                
                <?php get_sidebar('left'); ?>                
            </div><!--Main left-->               
            <?php get_sidebar(); ?>                                 
        </div><!--container-->
    </div><!--wrap-->   
<?php get_footer(); ?>

header.php


<!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js">
    <head>
        <meta charset="<?php bloginfo( 'charset' ); ?>" />
        <!--[if IE]>
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <![endif]-->

	<link rel="profile" href="http://gmpg.org/xfn/11">
	<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    <title><?php wp_title( '|', true, 'right' ); ?></title>
<?php if (mom_option('mom_og_tags') == 1) { ?>
    <?php if (is_singular()) { ?>
    <meta property="og:image" content="<?php echo esc_url(mom_post_image('medium')); ?>"/>
    <meta property="og:image:width" content="<?php echo get_option( 'medium_size_w' ); ?>" />
    <meta property="og:image:height" content="<?php echo get_option( 'medium_size_h' ); ?>" />

    <?php
        $mom_og_title = get_the_title();
    if (function_exists('is_buddypress') && is_buddypress()) {
        if ( bp_is_user() && !bp_is_register_page() ) {
                $mom_og_title = bp_get_displayed_user_fullname();
        } else {
        $mom_og_title = wp_title('', false);
        }
    }
    ?>

    <meta property="og:title" content="<?php echo esc_attr($mom_og_title); ?>"/>
    <meta property="og:type" content="article"/>
    <meta property="og:description" content="<?php global $post; $excerpt = $post->post_excerpt; if ($excerpt == '') { $excerpt = $post->post_content;} echo esc_attr(wp_html_excerpt(strip_shortcodes($excerpt), 200)); ?>"/>
    <meta property="og:url" content="<?php the_permalink(); ?>"/>
    <meta property="og:site_name" content="<?php echo esc_attr(get_bloginfo( 'name' )); ?>"/>
<?php } else { ?>
    <meta property="og:image" content="<?php echo esc_url(mom_option('logo_img', 'url')); ?>"/>
    <meta property="og:image:width" content="<?php mom_option('logo_img', 'width'); ?>" />
    <meta property="og:image:height" content="<?php mom_option('logo_img', 'height'); ?>" />
<?php } ?>
<?php } ?>

	<?php if(mom_option('enable_responsive') != true) { ?>
	<meta name="viewport" content="user-scalable=yes, minimum-scale=0.25, maximum-scale=3.0" />
	<?php } else {  ?>
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<?php } ?>
    <?php if(mom_option('sharee_print') != 0) { ?>
    <link rel="stylesheet" type="text/css" href="<?php echo MOM_CSS; ?>/print.css" media="print" />
    <?php } ?>
	<?php if ( mom_option('custom_favicon', 'url') != '') { ?>
	<link rel="shortcut icon" href="<?php echo mom_option('custom_favicon', 'url'); ?>" />
	<?php } ?>
	<?php if ( mom_option('apple_touch_icon', 'url') != '') { ?>
	<link rel="apple-touch-icon" href="<?php echo mom_option('apple_touch_icon', 'url'); ?>" />
	<?php } else { ?>
	<link rel="apple-touch-icon" href="<?php echo MOM_URI; ?>/apple-touch-icon-precomposed.png" />
	<?php } ?>
<?php wp_head(); ?>
</head>
    <?php
        if (is_single()) {
            global $post;
            $schema = 'role="article" itemscope="" itemtype="http://schema.org/Article"';
            if (get_post_meta( $post->ID, 'mom_review_post', true ) == 1) {
                $schema = 'itemscope="" itemtype="http://schema.org/Review"';
            }
        } else {
            $schema = 'itemscope="itemscope" itemtype="http://schema.org/WebPage"';
        }
    ?>
    <body <?php body_class(); ?> <?php echo $schema; ?>>
    <?php do_action('mom_first_on_body');
        if (isset($_GET['login']) && $_GET['login'] == 'failed') {
            echo '<div class="alert-bar hide"><p>'.__('Sorry your username or password is incorrect.', 'theme').'</p></div>';
        }
   ?>
    	<!--[if lt IE 7]>
            <p class="browsehappy"><?php _e('You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.', 'theme'); ?></p>
        <![endif]-->
    	<?php if(mom_option('bg_ads') == true) { ?>
        	<a style="height:<?php echo mom_option('bg_ads_h', 'height'); ?>" class="ad_bg" href="<?php echo mom_option('bg_ads_url'); ?>" target="_blank">&nbsp;</a>
        <?php } ?>
        <?php
        $mom_layout = '';
		$theme_layout = mom_option('theme_layout');
		if (is_singular()) {
		    $theme_layout = get_post_meta($post->ID, 'mom_theme_layout', true);
		    if ($theme_layout == '') {
			$theme_layout = mom_option('theme_layout');
		    }
		}
        if($theme_layout == 'boxed') {
            $mom_layout = ' class="fixed_wrap fixed clearfix"';
        } else if($theme_layout == 'boxed2') {
            $mom_layout = ' class="fixed_wrap fixed2 clearfix"';
        } else {
            $mom_layout = ' class="fixed_wrap"';
        }
        ?>
        <div class="wrap_every_thing">
        <div<?php echo $mom_layout; ?>><!--fixed layout-->
            <div class="wrap clearfix"><!--wrap-->
                <header class="header"><!--Header-->
                <div id="header-wrapper"><!-- header wrap -->
                <?php get_template_part('topbanner'); ?>
				<?php if(mom_option('tb_disable')) { get_template_part( 'framework/includes/topbar' );  } ?>

                    <div class="header-wrap"><!--header content-->
                        <div class="inner"><!--inner-->
                        	<?php get_template_part( 'framework/includes/header-content' ); ?>
                        </div><!--inner-->
                    </div><!--header content-->
                </div><!-- header wrap -->

				<?php get_template_part( 'framework/includes/navigation' ); ?>

                <?php if(mom_option('bn_bar')) { get_template_part( 'framework/includes/breaking' ); } ?>

            </header><!--Header-->
             <?php get_template_part('unavbanner'); ?>
            <?php do_action('mom_before_content'); ?>

(style.css)


/*-----------------------------------------------------------------------------------

	Theme Name: مولتی نیوز
	Author: Momizat
	Author URI: http://www.momizat.com
	Version: 2.9.9

	Tags: dark, light, white, black, gray, one-column, two-columns, left-sidebar, right-sidebar, fixed-layout, fluid-layout, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-image-header, featured-images, flexible-header, full-width-template, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready



License:
License URI:

General comments (optional).
-----------------------------------------------------------------------------------------*/

 

 

میشه بگید دقیقا کجا می خواهید نمایش بدید

لینک به ارسال

به گفتگو بپیوندید

هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .

مهمان
ارسال پاسخ به این موضوع ...

×   شما در حال چسباندن محتوایی با قالب بندی هستید.   حذف قالب بندی

  تنها استفاده از 75 اموجی مجاز می باشد.

×   لینک شما به صورت اتوماتیک جای گذاری شد.   نمایش به صورت لینک

×   محتوای قبلی شما بازگردانی شد.   پاک کردن محتوای ویرایشگر

×   شما مستقیما نمی توانید تصویر خود را قرار دهید. یا آن را اینجا بارگذاری کنید یا از یک URL قرار دهید.

×
×
  • اضافه کردن...