If “/styledtwentyfifteen” is your child directory then that’s included by get_stylesheet_directory_uri()
(of which bloginfo('stylesheet_directory')
is an alias) so you should leave it out on registering:
function register_more_stylesheets() {
wp_register_style( 'stylesheet_name', get_stylesheet_directory_uri() . '/background-slider-template.css' );
}
Similarly with is_page_template()
you only need the file name (relative to the template directory), and if you register a style you should just use its handle when enqueuing:
function add_my_stylesheet() {
if ( is_page_template( 'background-slider-template.php' ) ) { // using page slug
wp_enqueue_style( 'stylesheet_name' );
}
}
Related Posts:
- Copyright info change in Theme Child PHP
- Add footer.php to WordPress child theme
- Understanding child theme functions.php
- Parent theme CSS overriding child CSS rules
- child parent styles enqueue order
- Why would the child theme load in the Customize preview, but not on the site itself?
- AJAX numerical pagination problem in TwentyFifteen-child theme
- Modify arguments for parent theme’s `wp_register_style` via child theme
- Override get_template_directory() in child theme?
- why is translation not working on theme?
- Has anyone tried putting PHP ActiveRecord on WordPress?
- How do I remove a require_once admin panel from the parent theme from the child theme functions.php?
- is there a simple way to list every templates / php files used to generate a specific page?
- Setting up the child theme so as to enable right-to-left WordPress?
- Enqueue less file not working in child theme?
- I want to remove the links from the term list returned by get_the_term_list
- Can I run custom php on specific pages in wordpress?
- How to stop PHP code running when in a child theme
- Successful or Error Message after running mysql code in functions.php
- wp_enqueue_style with style.php and WordPress functions
- Is it possible to use the featured image of a page as a css background without inlining?
- Can I view my own wordpress php source code on my hosted web server?
- child theme inherticance and php autoload
- How do I target the child theme with get_bloginfo();?
- Deregister and Dequeue Stylesheets From a Plugin and Enqueue a Child’s Stylesheet/s
- How to display php source code inside a post using visual editor?
- How to enqueue CSS and JS only on specific template?
- Deregistering a script in WordPress seems impossible
- Can’t extend some core classes
- Hide wordpress field if data is empty in post!
- Where to edit the template that is generating the code for dynamic_sidebar left-sidebar in the Understrap theme? [closed]
- Latest post in a specific menu
- Cause of Blank Lines Being Added to WP FIles?
- How to save checkbox values for logged in users?
- I have a problem in the order of enqueues while enqueuing stylesheets and scripts for a specific page in my function.php
- two columns of posts on homepage, one of them “favorites”
- Need help enqueueing webfonts
- Whats the proper way to use a php stylesheet in a wordpress theme? [duplicate]
- Font Awesome changing default WordPress Font
- responsive.css in the WordPress should be prioritized
- Custom Background by Page IDs
- Copyright info change – Corporate Plus Theme PHP [closed]
- Is the wp_enqueue method efficient?
- Started getting warning message following host’s PHP upgrade
- Divi change project category slug
- What’s a good way to allow overwriting files within a child theme if I want the same folder structure?
- WordPress filter load_textdomain_mofile not working inside a child theme’s functions.php but works form inside a plugin
- Use custom template on custom post type
- How to have different site identity logos on each page on Astra Theme [closed]
- Fatal error: Uncaught Error: Call to undefined function get_header() [closed]
- Include style.css in the Child Theme with PHP
- Problems clearing cache
- Removing “Powered by” footer using child theme PHP [closed]
- Overide Variable in Child Theme
- How to style injected code in header section?
- Where should I copy a PHP file from wp-includes to, in order to override it in my child theme?
- Child Theme’s Read More Text
- Conditionally remove comments and post meta in functions.php
- Trying to change featured image from 180×180 to full width on home page
- How to edit background color of only one sidebar?
- PHP code snippet to remove microdata
- Counting number of posts in multiple (sub)categories using shortcode
- Need help for some PHP code
- Woocommerce display orders with products from specific categories to specific admins
- How to preload header logo image in WordPress? like what’s the code and where do I put it?
- Proper way to remove html code on child theme
- File from parent theme imported to child theme doesn’t work – any ideas?
- Problem with displaying CSS Stylesheets – Am I adding them correctly in my wordpress child theme?
- PHP “warning include_once(): Failed to open stream” Simple HTML DOM in WordPress Child Theme
- How to put 2 php codes in functions.php without site crashing
- Enqueue assets from multiple directories using add_action/do_action
- Call a single function on two different methods with hooks
- How to edit button permalink inside function.php using a child theme?
- How to locate parent theme functions and add functions to my wordpress child theme?
- Modifying child theme’s header
- WordPress files break if I edit them, but adding a closing PHP tag fixes it
- Add the shortcodes from the enfold theme to the other theme
- WordPress child theme, creating a custom php template page
- random woocommerce categories are not showing when count enabled?
- style.min.css code issue
- Add Text Area To Child Theme’s Home Page
- Local WordPress from Git repo, where to set document root?
- Where to find the html for WordPress site? [closed]
- Chosen Select jquery Not Working in Plugin
- How to remove image on single product and get product to span page?
- how to run a php code in widget?
- Removing get_template_part in child theme
- how to add number value in front for variable [closed]
- wp add inline style in loop
- Blog only showing code
- why is markup routinely placed in functions in wordpress?
- Themes with variable width or single columns? I want to display source code
- How to NOT override inline css rules
- Open all external links in new window – need help with the code
- How to get the Woocoomerce subtotal value without tax in the hardcode? [closed]
- Divi – add title to mobile menu button
- Dynamically added text at bottom of article – non searchable by PHP code
- How can I use AJAX in child theme template?
- functions.php doesn’t load all custom theme assets
- how to create twitter card without plugin in wordpress website?