You’re enquing on the admin_enqueue_scripts hook, which is why it’s only showing up on admin pages
If we look at an example from the official documentation:
/**
* Proper way to enqueue scripts and styles
*/
function wpdocs_theme_name_scripts() {
wp_enqueue_style( 'style-name', get_stylesheet_uri() );
wp_enqueue_script( 'script-name', get_template_directory_uri() . '/js/example.js', array(), '1.0.0', true );
}
add_action( 'wp_enqueue_scripts', 'wpdocs_theme_name_scripts' );
we see the wp_enqueue_scripts
hook being used instead. Use that hook instead of admin_print_styles
to print on the frontend
Related Posts:
- How to load different css file for different pages
- Is it possible to enqueue CSS files from plugin before theme’s CSS files?
- Making a plugin only available on the front-end for the logged in super admin
- Adding Font Awesome to WP Plugin
- wp_enqueue_style on template_redirect level?
- is it possible to hook every page style?
- wordpress plugin add page when activate
- How to add styles to a submenu page?
- Pass PHP variable to javascript
- Namespaces in WordPress – How do I initiate the main class?
- wordpress get meta value by meta key
- What areas to Unit test while building a plugin?
- Get info (url) from already enqueued styles
- update_meta_user difference in i:1 and b:1, how to write b:1
- Registration Form Validation in wordpress
- Plugin throws up 404 on front-end when when enqueuing style with filetime
- Errors while using ajax from external wordpress page
- Pass A Value From Outside To A Plugin Variable
- Dequeue / Deregister script and replace it with a new plugin
- How to handle autoloading with composer by keeping the WordPress naming conventions?
- filemtime() warning when enqueuing style within plugin
- Hide Theme options and Customize Admin menu
- Current user in plugin returns NULL
- What are the benefit in adding hook in the init() hook?
- How can I implement a notification system in wordpress?
- Minimum PHP Required for WordPress
- Building an email signup form. Where should the information be saved in the DB?
- Custom form action to handle data inside a plugin
- WP Post Template – Templates in own folder
- Create entire wordpress as a github repositery?
- Map Custom Registration Fields to WordPress User Roles
- custom payment gateway in woocommerce failed to connect to remote api server
- Plugin options page with live preview?
- Ajax call returning 0
- How to update post’s content on post publish?
- Conditional attributes and logic per product category
- WordPress plugin admin html being shown in Customizer iframe
- Displaying Custom Sidebar Without Modifying Theme’s Core File?
- WordPress Widget – Saving multidimensional arrays into $instance
- Ordering taxonomies by rank
- Plugin Options not being output
- Can I create a table on my DB without creating a plugin?
- Submit Form data to another page via Ajax (WordPress Way)
- WordPress checkbox and Illegal string offset
- Is it fair to use MIT licensed code in WordPress plugins? [closed]
- How to add an element right after the article using jQuery?
- How to reset wordpress but not plugins and settings
- add_submenu_page returns null
- get_option / wp_localize_script Not Working in OOP Plug In
- Switch from wp-cron to a server cron job
- Plugin not properly prepared for localization
- WordPress Active Plugins
- Redirect logged in user to somepage on every page view?
- adding custom code as a wordpress plugin
- How to add filter for wordpress plugin?
- How To Create A File Archive in WordPress?
- Adding a jQuery modal dialog to the admin area
- Custom Post Type, Custom Columns List
- Edit all $wp_scripts at once to $in_footer = false
- i need to make custom cron_schedule with custom interval time as a parameter into a custom payment gateway plugin wordpress
- How to upload large media file in chunks, without any plugin?
- How to set Google Analytics tracking code on WordPress plugin directory page?
- How to store a secret for a plugin inside public_html
- Cannot run script properly with my custom plugin
- Cookie value changes back to previous value after changing
- Problem with checked box on wp car manager plugin
- How to use functions found inside pluggable.php with my plugin files
- Is it okay to make a plugin to the WordPress repo, but limit it’s actions to maximum N events?
- Highlight admin menu items that are parent of existing core items
- Create a link that calls our custom function in WordPress
- Getting all woocommerce products from REST API call in plugin
- Update a previous version of plugin when the new plugin is built from the scratch
- AJAX update fails for public/non-admin users
- WordPress Product Detail and catalog
- Woocommerce list variations that are added already to cart in Single Product
- Plugin json page
- Passing ajax variable to more than one wordpress plugin function
- search into subcategories plugin subcategory value not come
- Why isn’t my plugin seeing other classes?
- How Can the_post Be Hooked Like the_content and the_excerpt?
- Create Database Tables on Plugin Activation hook
- How to add php stylesheet to admin section instead of admin_head hook
- How to tell which Plugin is displaying?
- Change page according to fetched GET Parameters
- How to change a specific page to custom page?
- Get Core Functionality from Within a (Secondary) Plugin File
- wp_insert_post_data filter to set category
- Plugin keeps saying needs to be updated and it’s in a constant loop [closed]
- How use Dynamic hyperlink on each wordpress post?
- How to provide access to specific plugin to all the user roles except subscriber in wordpress
- Output pure JSON wordpress
- how to remove a rel=”nofollow” using call to action plugin
- Activate plugin button do nothing [closed]
- Create Custom Coupon Type
- Plugin Block at the backend of every page or post
- How to provide page_template path in custom plugin using WordPress
- WordPress custom block: Link saved in database not retrieved when editing post
- Accessing Correct Database to Create REST API Endpoint
- Detect if user is on the specific page in WordPress
- A multi-section WordPress store [closed]