最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - retrieve "Link Color" value

programmeradmin1浏览0评论

I've set the Link color using the color picker in the front end. I want to use this color for buttons on the site so I used the following code in header.php

<style>
.btn{
    background-color: <?php echo get_theme_mod( 'link_color' ); ?>;
}
</style>

It worked and I could see the buttons change color to whatever I picked for Link Color setting. But it shows up only in Customization window. When I hit Publish and reload the site, I see the function is not returning any value.

<style>
.btn{
    background-color: ;
}
</style>

This is what I see when I inspect element.

Also, I've used

.site,body{
    background-color: #<?php echo get_theme_mod('background_color'); ?>!important;
}

in header.php and it loads the color properly. I can used background_color , page_background_color, secondary_text_color with get_theme_mod and also get_option functions but not link_color or main_text_color.

How do I retrieve Link Color ?

发布评论

评论列表(0)

  1. 暂无评论