You need to make sure that your css goes between style tags. Try changing this line:
.btn { background-color:<?php echo esc_attr($btn_color);?>; } <?php
to
<style>.btn { background-color:<?php echo esc_attr($btn_color);?>;</style> } <?php
Related Posts:
- Display random categories on the front page (Finding and Editing Theme Functions)
- is_customize_preview() like function to check if Customizer “Live Preview” in JavaScript
- Some questions about how proper add 2 CSS file in a WordPress theme?
- Getting the teaser text without overriding global variables
- “options.php” not found
- Why a SlideShow (made using JQuery FlexSlider) can’t work if I load it form functions.php but work if I load it from my footer.php file? [closed]
- Why I can’t load my JavaScripts using an hook inside my functions.php file?
- How to get postId from the argument $block when register_block_type()?
- How to load scripts/styles specific for a page
- Using classes instead of global functions in functions.php
- Is it ok to use a function to output the text domain name in a wordpress theme
- TinyMCE custom styles remove class when switching styles
- Hourly Routine Not Firing ( wp_schedule_event() )
- Show/hide Widgets in Dashboard Based on Current Advanced Custom Fields Option
- Return only top-level navigation items from a menu using wp_get_nav_menu_items
- which is the function that removes accented vowels?
- How do I “unhook” / de-register jQuery so that it’s not called as part of wp_footer();?
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- Add inline css to theme
- Is there an error in get_the_tag_list()?
- Returning Variables back into a template
- Where does function_exists() look to decide whether a function exists? [closed]
- Add external js file to footer with id
- How to add background image control to page admin controls?
- Best Practice for Syncing Local Development With Staging Development [closed]
- How to use thumbnails in gallery?
- Logic to Print/echo a css class only for 1st post and ignore all post after 1st? [closed]
- When using wp_enqueue_script(); in a theme why don’t we use add_action?
- How to remove howdy dropdown menu content
- Can’t load WP function into external function
- How to use Internationalized human_time_diff() function in Chinese?
- is_dynamic_sidebar always returns true while using Jetpack visibility
- How can I change the do_action function in footer (copyright area)
- Why does the ‘wp_nav_menu’ function work only until a menu is created?
- Override a theme function in a child theme?
- changing behaviour of get_search_form
- Pulling Twitter RSS feed not working as expected (fatal error)
- Translation of theme using child theme
- Use register_setting() in a loop
- Theme functions.php file auto delete everyday [closed]
- Add dynamic links in WordPress custom theme
- WordPress website Rs changed to currency symbol
- Search filter by Post title OR Meta Title Value [duplicate]
- how can I edit flexslider in woocommerce. [Urgent]
- Functions in custom theme
- Jquery implementation not working on page reload
- Parse error after modifying the template menu [closed]
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- Usage of theme name in functions
- How do I link a button I created in theme customizer to a function?
- Functions.php Problem
- Is the “_s” on this `sprintf(__(‘Page %s’, ‘_s’), max($paged, $page))` just refer to a text domain?
- ACF not showing
- Check if the image size is available and if not use ‘full’ image size
- Way to store featured image width and height in two separate variables?
- Can we create our own theme’s function.php?
- Not all CSS elements transferring via parent to child?
- Define PHP variable from a seperate API if statement
- Excerpt for pages not showing
- get_template_directory adding FTP root folders in urls
- Filter nav menu items HTML tags and wrap inner text with span
- Does size of a theme’s functions.php file matter?
- get_next_posts_link() returns no result despite available posts
- Nav menus all outputting the same links
- PHP 7.1 | Warning: A non-numeric value encountered in
- Redirect website domain (including all pages) to external URL after Popup message (few seconds)
- How to insert class in each list of categories?
- I can’t add CSS with functions.php
- Combine two active_callbacks into one on theme customizer
- How to store a number (coming from cookie) into query vars for later usage in other filters?
- Is this an acceptable practice for WordPress theme development?
- What is the correct way to include my new functions and scripts in WordPress?
- wp_nav_menu work in functions.php but not in the theme
- Rewrite Question Mark in Post Template with URL Parameter for clean URLs
- How do I preserve changes to a theme’s functions.php across updates?
- How can I assign separate stylesheets to different pages?
- How to make sure relative URL works when site is not on root domain?
- Removing the custom_image_header from wp_head
- Uncaught TypeError: extract(): Argument #1 ($array) must be of type array, null given
- How to fix Function create_function() is deprecated in / themes
- WordPress wp_dequeue_script remove all other scripts
- Can I use ‘Featured Image’ as a hero image and a thumbnail?
- Class parameter in get_avatar args doesn’t get added to output
- CSS style and app.js not loading
- How to customize archive widget only for cpt?
- wp_title() return random number
- How to offset main query without affecting other queries and backend
- Menu to the right of screen on desktop using Bootstrap 4
- HowTo: Add wrapper to columns shortcode?
- How to create admin ajax function for my contact form
- How to disable site title and description when custom header is uploaded on the customizer?
- us states dropdown function and echo in theme template files
- How to pass a variable from a template page to the child theme functions.php
- wordpress not calling peliegro functions.php?
- Load a Child Theme’s style.css just before the closing tag
- Random text changing to weird icons in both admin & front end
- Add the title of a widget as an ID – for anchor links
- Which template file to edit to edit homepage in Mystile [closed]
- Adding function to function.php error 505 [closed]
- How to automatically load Google Fonts on pages only as they’re used?