WordPress.org

Ready to get started?Download WordPress

Forums

wp_enqueue_style (2 posts)

  1. Luigino
    Member
    Posted 5 years ago #

    Hello everyone!!!

    Anyone knows if it exists a function similar to wp_enqueue_style to enqueue an alternate stylesheet?...
    And is there the possibility to add title parameter to wp_enqueue_style to have also title attribute in the <link> tag due for changing styles when I want pressing a button?...

    Thanks to everyone in advance!
    Ciao,
    Luigi

  2. Luigino
    Member
    Posted 5 years ago #

    Just an update.....

    I was looking and studying the file functions.wp-styles.php and I figured there's a code that says:

    $_handle = explode('?', $handle);

    this makes me to think I could write something like:

    wp_enqueue_style("OwnGallery?title='owngallery'?alt='alternate stylesheet'",...)

    but when I look inside class.wp-styles.php I see this:

    echo apply_filters('style_loader_tag, ', "<link rel='stylesheet', href='$href' type='text/css' media='$media' />\n", $handle);

    so that makes me asking myself: how I can now reproduce a result like:

    <link rel='alternate stylesheet' title='alternate_gallery' href='alternate_gallery.css' type='text/css' media='screen' /> ?

    Any suggests?
    Thanks to all!
    Ciao, Luigi

Topic Closed

This topic has been closed to new replies.

About this Topic