WordPress.org

Ready to get started?Download WordPress

Forums

css links: hard coded vs bloginfo( 'stylesheet_url' ) (3 posts)

  1. Smittie
    Member
    Posted 1 year ago #

    I am in the process of moving from MovableType to WordPress.

    What are the trade offs between using bloginfo( 'stylesheet_url' ) and hand coding links to style sheets in the header.php file?

    I am currently working on a template that I will use only for my own site. I prefer to edit the source files directly for things like html and css and use the CMS software for managing the content. When I am setting things up for other people to use and manage, I try to make sure that they can make full use of software tool (ie WordPress) to manage as many aspects of the site as possible. I suspect that using bloginfo( 'stylesheet_url' ) falls into this dilemma.

    Smittie

  2. graphicgeek
    Member
    Posted 1 year ago #

    bloginfo('stylesheet_url') is just a dynamic way to point to the directory in which your active stylesheet resides. The main advantage to using this is that if you move the theme to a different url (for example, transferring from a development site to a "live" site), you need only update the database, and any links in the theme files that are using bloginfo('stylesheet_url') will still work.

  3. Smittie
    Member
    Posted 1 year ago #

    OK, so that makes a lot of sense for theme development so that the end user doesn't need to set the path by hand. In the case of my personal site, making the choice to hand jam the URLs for the style sheets shouldn't incur any drawbacks.

    Further feedback still appreciated. GraphicGeek, thank you very much.

Topic Closed

This topic has been closed to new replies.

About this Topic