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
- Is the wp_enqueue method efficient?
- PHP nested If statement syntax
- Started getting warning message following host’s PHP upgrade
- Display Data in Table from External Database in WP using Shortcodes
- linking stylesheets and scripts with functions.php
- get_template_directory adding FTP root folders in urls
- How to Configure Events List in WordPress to Disappear Event Once Date is Past
- Why does the Woocommerce grouped template prints the unpublished products?
- Code snippet to show current php version inside “At a Glance” box in admin
- How to edit HTML of my website on WordPress? [closed]
- How to: Conditionally Enqueue JS and Stylesheets, for Custom Post Type (Single and Archive Templates)
- Divi change project category slug
- How to specify the path for require_once in a child theme?
- Warning: printf(): Too few arguments in helpers.php file
- 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
- How do I check or test a WordPress Auto Year Change Script?
- 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
- Creating a child theme after numerous edits to parent theme
- How to make a cookie be on the whole site instead of being on a specific page/
- How to style injected code in header section?
- Accidentally deleted php code in WordPress website [closed]
- 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
- Enqueueing a code block from an options framework
- Need advice on theme customizer and child themes
- random reason on refresh
- Conditionally remove comments and post meta in functions.php
- Trying to change featured image from 180×180 to full width on home page
- Insert PHP code in Text
- How to edit background color of only one sidebar?
- PHP code snippet to remove microdata
- Inline CSS header style priority function.php Child (no enqueing I think)
- 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
- Woocommerce template file outputting tags
- Copying and pasting to WordPress “code editor” code via the front end and clipboard
- 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
- Child-Theme Category View with modified permalinks (%category% removed)
- remove_action from parent theme using child theme functions.php
- 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?
- How to change this ajax function to submit to the default wordpress content area instead of the custom field ‘seller notes’?
- Child theme overirde template-tags in a theme built on underscores in inc/template-tags
- 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
- Fatal error: Uncaught Error: Class ‘WP_Block_Styles_Registry’
- Call a single function on two different methods with hooks
- Load script and styles using an array of resources
- How to change the structure/order of sections in a WordPress theme? [closed]
- 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?
- How to let mobile navigation menu close when link is clicked?
- how to add functions to my function.php using a child theme?
- Modifying child theme’s header
- Displaying SQL query result from user input via wpdb
- How to Change Site Elements based on referring URL
- 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
- If i use a child theme to add new code blocks to header.php, how does it get inserted in the right place in parent’s header.php?
- WordPress child theme, creating a custom php template page
- How to override html codes in wordpress?
- admin-ajax.php 400 bad request – whats wrong with my code?
- random woocommerce categories are not showing when count enabled?
- style.min.css code issue
- Add Text Area To Child Theme’s Home Page
- How to add Open/Close Toggle button into Twenty Fifteen theme for hiding left sidebar?
- Local WordPress from Git repo, where to set document root?
- Adding custom PHP to existing loop in Genesis
- Where to find the html for WordPress site? [closed]
- Child theme functions.php file change database entries
- 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
- Child theme not working properly
- Blog only showing code
- Display pages from specific page template
- why is markup routinely placed in functions in wordpress?
- Themes with variable width or single columns? I want to display source code
- How can I print out a single stylesheet or javascript link?