• HI all, how can I change bloginfo variables especially bloginfo(‘stylesheet_url’)in HEADER.PHP in the theme folder.?

    in fact I want a way to use the rtl.css with style.css to make the alignment from right to left.

    thank you

Viewing 4 replies - 1 through 4 (of 4 total)
  • <?php bloginfo('template_url') ?>/rtl.css

    Thread Starter majedonlinehotmailcom

    (@majedonlinehotmailcom)

    thank you.. I added your line in the header.php in the theme. and many elements became right. in the other hand there is not any effect of dir=”rtl” in the html tag !!

    also I noted there are many css files with rtl suffix in the wp-admin. But I don’t know how to use them or how to let the design of the control panel take care of them .. any idea ??

    If you want to actually change it:

    Add the following code to your functions.php file.

    add_filter(‘stylesheet_uri’, ‘change_css’);

    function change_css() {
    return “https://website.com/yourcssfile.css&#8221;;
    }

    WordPress loads the functions.php file prior to loading the template files. The add_filter we use here modifies stylesheet_uri, so when it gets called within your template, it will be the path you specified.

    You can do this with most bloginfo variables.

    View wp-includes/theme.php if you are curious what else can be modified, anything with “apply_filters(“whatever”)…..” can be modified, just replace whatever with what you’re modifying in your add_filter.

    Good luck

    Perhaps this is a better example:

    add_filter(‘stylesheet_uri’, ‘change_css’);

    function change_css() {
    return get_bloginfo(‘template_url’) . ‘/my_custom_stylesheet_name.css’;

    }

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘change bloginfo and customizing a stylesheet’ is closed to new replies.