Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8020815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:47:47+00:00 2026-06-04T21:47:47+00:00

My current PHP code is working and styling my Theme Options page (located under

  • 0

My current PHP code is working and styling my “Theme Options” page (located under the WP API Appearance menu) the way I want it to look, however…

The CSS stylesheet is also being applied to every other menu in the WP dashboard (such as affecting the “Settings > General-Options”) page too. How am I able to go about applying the stylesheet just to my “Theme Options” page only and not tamper with anything else?

My stylesheet is named ‘theme-options.css”, located within a folder called “include” > include/theme-options.css. The code below is placed within a “theme-options.php” page.

<?php
// Add our CSS Styling
add_action( 'admin_menu', 'admin_enqueue_scripts' );
function admin_enqueue_scripts() {
    wp_enqueue_style( 'theme-options', get_template_directory_uri() . '/include/theme-options.css' );
    wp_enqueue_script( 'theme-options', get_template_directory_uri() . '/include/theme-options.js' );   
}   
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T21:47:48+00:00Added an answer on June 4, 2026 at 9:47 pm

    I was placing the CSS & JS files separately from the building blocks of my page (just above that function). The code is now inside my page build function and I am now getting the results I was after.

    Previously:

    ...
    // Add our CSS Styling
    function theme_admin_enqueue_scripts( $hook_suffix ) {
        wp_enqueue_style( 'theme-options', get_template_directory_uri() . '/include/theme-options.css', false, '1.0' );
        wp_enqueue_script( 'theme-options', get_template_directory_uri() . '/include/theme-options.js', array( 'jquery' ), '1.0' );     
    
    // Build our Page
    function build_options_page() {
    
    ob_start(); ?>
        <div class="wrap">
            <?php screen_icon();?>
    
            <h2>Theme Options</h2>
    
            <form method="post" action="options.php" enctype="multipart/form-data">
    
            ...
            ...
    

    Solution:

    // Build our Page
    function build_options_page() {
    
    // Add our CSS Styling
    wp_enqueue_style( 'theme-options', get_template_directory_uri() . '/include/theme-options.css' );
    wp_enqueue_script( 'theme-options', get_template_directory_uri() . '/include/theme-options.js' ); 
    
    ob_start(); ?>
        <div class="wrap">
            <?php screen_icon();?>
    
            <h2>Theme Options</h2>
    
            <form method="post" action="options.php" enctype="multipart/form-data">
    
            ...
            ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to create simple PHP COMET server page displaying current time? I need code
My current code (not working): <label for=homepage><h3>Home Page Image</h3></label><input type=hidden name=MAX_FILE_SIZE value=300000 /><input type=file
Using Php I would like to extract the current Url of a page including
Possible Duplicate: How do I get current page full URL in PHP How can
My htaccess have this code # # Apache/PHP settings: # Options -Indexes Options +FollowSymLinks
I'm working on a PHP parser that parses my school's HTML 'groups' page. These
Ok this code seems to be working now (ajax getting the current selection) .
Consider the following PHP code for printing current date: <!--Date as SEO optimization tool-->
Below is some code I am working on for a navigation menu, if you
I have a PHP code (wordpress) thats working fine, I just feel there is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.