both is_home()
and is_front_page()
works in the header or anywhwere you are using a theme template.
Most likely, the problem is because you’ve hardcoded this: /wordpress/wp-content/themes/roots/style.php
Try instead creating your url like this:
<link rel="stylesheet" type="text/css" media="all" href="https://wordpress.stackexchange.com/questions/85053/<?php echo get_stylesheet_directory_uri(); ?>/style.php?tcount=<?php echo $count;?>" />
Related Posts:
- home.php or frontpage (via settings) for theme?
- How can I make WordPress serve homepage to different URL?
- How do I make my single-work page show on my front-page.php?
- Create a front page template and separate page for posts?
- What does choosing a Post Page do?
- Try to run a function only on Home
- Using a conditional tag for the home page banner
- I want to load a pre-built php page (and assocated scripts/styles/directories) as the front page. How do I go about this?
- Accidentally deleted the ‘home’ page as my front page, can someone help?
- ‘Nothing found’ on home page after custom CSS edit
- Last single full post in home page, excerpts in blog list
- Override static home page post
- View homepage in a preview mode
- Natural URL Design and static front page
- If its not frontpage
- Changing the homepage
- Add Adsense code in index.php
- How to get the original post_id of a static home page?
- How to check if current static page is frontpage from admin plugin
- How to only show the first X words (from each post) on the home page?
- Query string becomes encoded when a static page is used as homepage
- Limit posts only on home page – ideally in functions.php
- front end publishing not working on front-end page
- WP Multisite Static Frontpage
- query_vars in home, not loading the “home” page
- get_home_path() returning error 500
- How to display thumbnail and excerpt of a page on homepage?
- How do I make the main page be the blog page and not a separate “home” page?
- Change Site Title and Description html tags if not home page
- How do I make the homepage as the blog page?
- When does WP ignore content added through the backend editor?
- How to set up a single portfolio page as home page?
- Overwrite style.css styles from index.php style
- Allow a static page to show on a dynamic home blog page before the posts
- How to make a video play for homepage?
- Template hierarchy about pagination after front-page.php
- How to get the true permalink of the static home page?
- Why does my homepage sometimes shows up in black and white text?
- style.css doesn’t load on the home page when front-page.php activated (using stock theme)
- static homepage no longer shows [closed]
- How can I make a portion of the home page user configurable?
- Page-loop is looping content from custom loops on the same site. How to avoid that?
- Weird Symbols in Chrome (wordpress) [closed]
- Main timeline in a different path
- How can I confirm I’m on the home page
- How can I show/hide HTML elements if the page is_front_page
- My custom template page not loading content inside it?
- Recent posts on homepage
- Merging two pages into one homepage
- How do I get my blog posts to appear on homepage?
- improve my array to display the_title, category, excerpt for homepage
- index.php isn’t front page but shows as it is
- is_front_page and is_home are not working in page.php
- Finding the index page using the admin panel of wordpress
- Theme Development -> Specific Homepage
- Different banner on home page
- Possible to Alternate between Two Home pages?
- How do I put my frontpage featured image in a page template for home.php?
- Working with WordPress theme
- How can I get $pagenow equals to the Home Page or specific page on my site?
- page 1 is not paged
- Show latest posts on responsive theme
- Fixed home page
- How to make my Home button on the menu redirect to my root page
- On home page remove link from logo
- wordpress help needed. How to display both home.php and index.php?
- 1 post per category on homepage and counting those posts
- homepage loading too slow
- Problems with homepage in different browsers
- Homepage Duplicated with each Post
- Ability to change homepage on WordPress using API
- Remove Home page slug in translated pages
- What is the difference between `Home page / Archieves` and the page set as homepage?
- Remove/Redirect /page/ from homepage WordPress
- Delete Title Bar
- Homepage was doubled and cannot be adjusted in Elements
- Homepage Setting missing
- How to detect if some page template has been selected
- How to get different homepage layout, based on the URL and customizer
- My blog index page shows the last post as a title?
- Homepage only shows URL after moving to different server
- Adding language attribute to homepage
- Show sticky blog post on homepage
- Use page.php for front page
- 3 x 3 grid of posts on the home page
- is_home() and is_front_page() not working in sidebar
- Removing template part when not on homepage if / else
- Set header for default posts page?
- Home in page/post not refer to homepage
- blank page with no code or errors on blog
- how to show the most viewed, random and recent posts in the home?
- Installing Google analytics to home page
- What is the advantage of using home.php over index.php for the front page
- How to access the so called “Posts page”
- Set home page to last page of a certain category
- How to wrap image logo in Homepage with H1 tag
- Hompage showing page from different theme
- Have image slider display only on home page
- How to display both home.php and index.php
- newbie help with home page