Here is a great tutorial on how to add a colorpicker to your admin page.
Regardless of how you are adding a colorbox or what plugin you are using, assuming you added it by adding a field in your options table (as provided in the link), you can use the color value anywhere in your template files with a call to get_option
:
$options = get_option( 'my-theme-options' );
$bg = $options['background'];
For example, as mentioned here, to colorize your first level headings add the call in your wp_head
section.
function my_wp_head() {
$options = get_option( 'my-theme-options' );
$color = $options['color'];
echo "<style> h1 { color: $color; } </style>";
}
add_action( 'wp_head', 'my_wp_head' );
Make sure you validate and escape appropriately when handling user inputs.
Related Posts:
- Add fields in customization tab to change background colours of certain classes
- Remove margin from CSS gradient color code
- Custom Gutenberg color classes naming convention
- Adding a new block editor color option to a theme
- Are there any CSS classes for the wordpress colours?
- How to insert spaces/tabs in text using HTML/CSS
- Dynamically change color to lighter or darker by percentage CSS
- How would you make two s overlap?
- CSS “margin: 0 auto” not centering
- How can I insert vertical blank space into an html document?
- How to make a
- display in a horizontal row
- CSS3 Scale Animation Keyframes
- JavaFX css themes
- Border Position
- Bootstrap align navbar items to the right
- Detect if a browser in a mobile device (iOS/Android phone/tablet) is used
- How to get multiple images to auto resize and stay centered within a div
- CSS rotation cross browser with jquery.animate()
- How do you avoid caching during development?
- How to specify a class added to my gallery
- Get parent category class in post_class()
- use add_action(‘wp_head’) in a widget for generating dynamic CSS styles
- Assign title-specific class to list items in menu based on WP pages
- WordPress – https : Css and Js files are not working (load on http instead of https)
- Is it possible to create a full width row in WordPress’s editor window? [closed]
- How do I find (index) file in order to change style on CSS?
- Enqueue style for Password Reset page
- Highlighting the current page in a navigation menu which links are generated with a custom loop?
- How to change header & footer to full width? [closed]
- Styleswitcher or themeswitcher to allow user to switch back to standard view from mobile device
- Remove WordPress/Gutenberg button styles for ACF blocks
- If post by specific role different css to everyone
- Theme Check errors about missing CSS rules
- removing my underline from hyperlinks
- How to override Gutenberg admin CSS
- WordPress stripping out BR tags, need assistance
- Use wp_add_inline_style to add code to before wp_head?
- How to Remove White Space above video Block
- Font Awesome wp_enqueue_style
- How to enqueue a random css style?
- Layout using Bootstrap not aligning correctly
- No styling on fresh wordpress installation
- How to include .css code in a WordPress page template?
- Enqueue Style Function Not Loading
- How to use Japanese characters for a single page
- Certain aspects of site suddenly not working in Chrome and Firefox
- How do I make header.php use different css for different pages?
- what could cause get_stylesheet_directory_uri() to fail?
- Delete a white space using css
- wordpress css file
- jQuery UI Theme that aligns perfectly with the admin UI
- CSS – why does my sidebar drops to the bottom of the page? [closed]
- How can I force Dynamic CSS via ACF values to update on page load?
- WordPress backend is loading without style
- How to integrate Bootstrap Grid System in WordPress
- After I change CSS not updating in the browser
- ACF Pro with SlickJS [closed]
- Show/Hide Div for Login Mask
- Where are the contents of WP_Head
- When replacing #site-title with an image – why must it be located in root?
- Scroll code block instead of wrapping text
- Divi CSS Flex/Margin Error
- How to make a function to play only on the home page?
- Redirect Css files to https
- How can I add a stylesheet to the Classic Editor page?
- Where to add this code for a Modal box to work? [closed]
- How to enqueue stylesheets in child-theme functions.php?
- Change class value using CSS
- Dequeue CSS of the Parent Theme
- Unable to use Datepicker in a table when inserting a row
- Text editor toolbar z-index conflict with location plugin pop
- Hide a div class on WordPress ID (Based on template) [closed]
- What is the cleanest way to shrink Gutenberg Blocks to container width?
- Gutenberg Editor: display error with a combination of transform and background-attachment:fixed
- How to replace wordpress css or js file with external file?
- all of a sudden my child theme style.css is being ignored? Its been working fine for months?
- How do I move my logo from the center to left (Pixgraphy theme)
- Page flickers when new html5 video loads
- Unable to properly load WordPress Admin page
- Change style of Twenty Seventeen child theme
- Setting up Custom Background [closed]
- Customiser colour picker and best practice for updating css
- Editing anchor style in main navigation bar
- My contact form is not being responsive
- Align form elements with css
- Load specific js & css based on class or ID?
- Using a style sheet for modern browsers and another for older browsers
- Outputting the blogposts or the_content()
- How to insert a clickable and fixed background [duplicate]
- Apply Classes to post text inside editor
- Use of CSS classes in editor-blocks.css file
- Twenty Twelve theme: remove margins
- Parent style messing up with Bootstrap [closed]
- Problems when writing a post
- Will the following code make my css deal with images in the optimum way?
- Interactive maps in wordpress
- WordPress CSS not working properly
- Add Custom CSS Class in Child Theme [closed]
- Editing size of h3 tag in wordpress on a one-off basis
- Content doesn’t fit on large size desktops like 2560×1440