• I’m hoping someone can help me. SO frustrating.

    The custom colors are not working in the panel, so the developer told me to add this code

    <style type="text/css">
    
        <?php $options = get_option('iw_opt'); ?>
    
    	/* start customstyles.php */
    
    	<?php echo $iw_opt['css-code']; ?>
    
    	<?php if( isset($iw_opt['primary-color']) and $iw_opt['primary-color'] != '#2c3e50' ) : ?>
    
    		/* primary color */
    
    		body,
    		nav .wrapper #bars .fa-bars,
    		.carousel .carousel-control i{
    			color: <?php echo $iw_opt['primary-color']; ?> !important;
    		}
    		@media (max-width: 767px){
    			.carousel h2 a{
    			color: <?php echo $iw_opt['primary-color']; ?> !important;
    			}
    		}
    
    		section#top,
    		section#chess article,
    		section#breakingnews ul li div.cat{
    			background-color: <?php echo $iw_opt['primary-color']; ?> !important;
    		}
    
    		.wrapper, .wrapper #mainmenu,
    		header .wrapper #logo,
    		header .wrapper #sublogo,
    		nav div.rowstyle,
    		hr, .hr,
    		section#content #main section.comments .commentlist li.comment:not(:first-child),
    		section#content #main section.comments .commentlist li.comment:not(:last-child),
    		section#breakingnews ul,
    		.wpcf7 input[type="text"],
    		.wpcf7 input[type="email"],
    		.wpcf7 select,
    		.wpcf7 textarea{
    			border-color: <?php echo $iw_opt['primary-color']; ?> !important;
    		}
    
    		section#breakingnews ul li div.cat:after{
    			border-left-color: <?php echo $iw_opt['primary-color']; ?> !important;
    		}
    
    	<?php endif; ?>
    
    	<?php if( isset($iw_opt['secondary-color']) and $iw_opt['secondary-color'] != '#ffcc0d' ) : ?>
    
    		/* secondary color */
    
    		section#top a:hover,
    		#mainmenu > li > a:hover,
    		.widget h4,
    		section#content #main #featured p time,
    		#content a:hover, #content a:focus,
    		footer a:hover, footer a:focus,
    		nav .wrapper #bars .fa-square,
    		nav #respmenu a:hover,
    		section#chess article .info ul,
    		section#content aside .wrapper p time,
    		#breakingnews a:hover,
    		.carousel .textinfo{
    			color: <?php echo $iw_opt['secondary-color']; ?> !important;
    		}
    
    		nav .wrapper #mainmenu li.menu-item-has-children ul.sub-menu,
    		.countcomments{
    			background-color: <?php echo $iw_opt['secondary-color']; ?> !important;
    		}
    
    		#mainmenu li a.hover:before,
    		section#content header.topinfo h1:after,
    		section#content article .textinfo:after,
    		section#content header.topinfo .textinfo:after,
    		section#content #main section.comments h3:after,
    		section#content.authors #users h2:after,
    		section#content.authors h1:after,
    		section#content article .textcontent a:hover,
    		section#content header.topinfo .textcontent a:hover,
    		section#content #main #featured h2:after,
    		section#chess article .quote .textquote:after,
    		section#content #main #articlelist article.format-quote .textquote:after,
    		.textinfo:after,
    		section#content #main .relatedposts h3:after{
    			border-bottom-color: <?php echo $iw_opt['secondary-color']; ?> !important;
    		}
    
    		#mainmenu li.menu-item-has-children ul.sub-menu a.hover:before {
    		  border-bottom-color: white !important;
    		}
    
    		.countcomments:after{
    			border-right-color: <?php echo $iw_opt['secondary-color']; ?> !important;
    		}
    
    		.widget h4:before,
    		section#content aside .wrapper{
    			border-color: <?php echo $iw_opt['secondary-color']; ?> !important;
    		}
    
    	<?php endif; ?>
    
    	<?php if( $iw_opt['single-dropcaps'] ) : ?>
    
    		.single-article .textcontent p:first-child:first-letter{
    			background-color: <?php echo $iw_opt['secondary-color']; ?> !important;
    			font-size: 210%;
    			float: left;
    			margin-right: 8px;
    			padding: 8px;
    		}
    
    		.single-article .textcontent blockquote p:first-child:first-letter {
    			font-size:100%;
    			float:none;
    			background-color:transparent !important;
    			margin:0;
    			padding:0;
    	}
    
    	<?php endif; ?>
    
    	<?php 
    
    	//only for the logo shadow
    	if( !$iw_opt['boxed'] and
    		isset($iw_opt['opt-background']['background-color']) and
    		( $iw_opt['opt-background']['background-color'] != '' or
    		$iw_opt['primary-color'] != '#2c3e50' )
    	) :
    
    		$bg = ($iw_opt['opt-background']['background-color'] != '')	? $iw_opt['opt-background']['background-color'] : '#ffffff';
    		$pr = ($iw_opt['primary-color'] != '#2c3e50' ) 				? $iw_opt['primary-color'] 						: '#2c3e50';
    
    	?>
    		/* logo shadow */
    
    		header .wrapper #logo{
    			text-shadow: 2px 2px 0 <?php echo $bg ?>, 4px 4px 0px <?php echo $pr ?> !important;
    		}
    
    	<?php endif; ?>
    
    	<?php if( !$iw_opt['boxed'] and
    		isset($iw_opt['opt-background']['background-color']) and
    		$iw_opt['opt-background']['background-color'] != ''
    	) : ?>
    
    		/* background */
    
    		.widget h4{
    			background-image: none !important;
    		}
    
    		.widget h4 span{
    			background: <?php echo $iw_opt['opt-background']['background-color'] ?> !important;
    		}
    
    		#loader{
    			background: <?php echo $iw_opt['opt-background']['background-color'] ?> !important;
    		}
    	<?php endif; ?>
    
        </style>

    into header.php file before </head> tag and after <?php wp_head() ?>

    However, it is still going to the pre-defined skins.

    https://danikloo.com/

Viewing 5 replies - 1 through 5 (of 5 total)
  • I don’t know the theme personally, so I can’t give first hand advice but it looks like the $options variable isn’t being used, but instead you’re using $iw_opt.

    Try switching $options to $iw_opt.

    As you can see in the 2nd line of the provided code, your storing the options array inside of the $options variable.

    So it would now be :

    <?php $iw_opt = get_option('iw_opt'); ?>

    Again, I’m not 100% as I don’t even know what theme you’re using, but it’s worth a shot.

    You can aslo try and check the value of $iw_opt['primary-color'] by echoing out it’s value:

    echo $iw_opt['primary-color'];

    to see if it is matching your conditional :

    <?php if( isset($iw_opt['primary-color']) and $iw_opt['primary-color'] != '#2c3e50' ) : ?>

    The theme the OP is using is : Old Paper Child

    Thread Starter BrendaSargeant

    (@brendasargeant)

    Thanks Evan, I appreciate your help.

    I tried changing the $options to $iw_opt, but nothing changed so I flipped it back.

    I’m lost on this part of your instruction:

    You can aslo try and check the value of $iw_opt[‘primary-color’] by echoing out it’s value…..

    can you dumb it down?

    I’m using a child theme on Old Paper theme, the newest version.https://themeforest.net/item/oldpaper-ultimate-magazine-blog-theme/7431822

    I don’t have access to the premium theme, and we don’t generally support them in this forum. Since you paid for it, you should be receiving support from the theme authors.

    Above the <script> tag you have above, try echoing out the value of the variable by doing:

    <?php echo 'The value of the primary color is : . $iw_opt['primary-color']; ?>

    That should let you know what is stored in that value, and why the conditional statement isn’t working.

    Thread Starter BrendaSargeant

    (@brendasargeant)

    I kind of am getting support but he is giving answers that don’t work and then I wait another 24 hours. Hence me coming here. I will get on his case again. Thanks again though for trying to help.

    This might sound like a strange question but where are you trying to add colors too? If your just trying to put a color background into a page of post add:
    <div style=”background-color: #0bdb9d”> (#number is color value)
    This line at the top of your “Text” page will color the page or post.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Custom color code not working’ is closed to new replies.