0
Welcome Guest! Login
0 items Join Now

Tutorial - How to Add Custom CSS File

    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: Tutorial - How to Add Custom CSS File

    Posted 11 years 11 months ago
    • I would never rely on the loading order.
      (css-compression can change the order).
      Use css specificity.
    • Dan Walker's Avatar
    • Dan Walker
    • Elite Rocketeer
    • Posts: 529
    • Thanks: 21
    • Designer/Developer

    Re: Tutorial - How to Add Custom CSS File

    Posted 11 years 11 months ago
    • The loading order of stylesheets is maintained in the compressed file using Gantry GZipper in my tests. This change simply saves time in not having to add another selector.
    • Dan Walker - Web Designer & Developer @ Top Webs Network
      Custom Joomla & Wordpress Websites
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: Tutorial - How to Add Custom CSS File

    Posted 11 years 11 months ago
    • well, things may change (in the near future) ... :)
    • Dan Walker's Avatar
    • Dan Walker
    • Elite Rocketeer
    • Posts: 529
    • Thanks: 21
    • Designer/Developer

    Re: Tutorial - How to Add Custom CSS File

    Posted 11 years 11 months ago
    • Where would you put the mycustomstyle.php to make it work with a WordPress template which has no features folder?
    • Dan Walker - Web Designer & Developer @ Top Webs Network
      Custom Joomla & Wordpress Websites
  • Re: Tutorial - How to Add Custom CSS File

    Posted 11 years 11 months ago
    • What I did was modify the index.php file in wp-content/themes/rt_fantry_wp folder by adding my style sheet to the array on line 14.

      HTH
    • Dan Walker's Avatar
    • Dan Walker
    • Elite Rocketeer
    • Posts: 529
    • Thanks: 21
    • Designer/Developer

    Re: Tutorial - How to Add Custom CSS File

    Posted 11 years 11 months ago
    • While that will work, the point of mycustomstyle.php is that the style sheet is automatically included into index.php, so even if there are template upgrades to index.php everything will work.
    • Dan Walker - Web Designer & Developer @ Top Webs Network
      Custom Joomla & Wordpress Websites
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: Tutorial - How to Add Custom CSS File

    Posted 11 years 11 months ago
    • Dan Walker's Avatar
    • Dan Walker
    • Elite Rocketeer
    • Posts: 529
    • Thanks: 21
    • Designer/Developer

    Re: Tutorial - How to Add Custom CSS File

    Posted 11 years 11 months ago
    • Thanks Henning. Here is the code to create the proper WordPress gizmo.
       
      <?php
      /**
       * @package   Custom Gizmo (Add custom stylesheet for WordPress) - RocketTheme
       * @version   May 16, 2012
       * @author    RocketTheme http://www.rockettheme.com
       * @copyright Copyright (C) 2007 - 2010 RocketTheme, LLC
       * @license   http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
       *
       *
       */
       
      defined('GANTRY_VERSION') or die();
       
      gantry_import('core.gantrygizmo');
       
      class GantryGizmoMyCustomStyle extends GantryGizmo {
          var $_name = 'mycustomstyle';
       
          function isEnabled() {
              return true;
          }
       
          function init() {
              global $gantry;
       
              $gantry->addStyles(array('template.css','fusionmenu.css','wp.css','typography.css','extensions.css','mycustomstyle.css'));
       
          }
       
      }
       
      Attached is a zip file containing mycustomstyle.php (place in the theme's gizmo folder) and mycustomstyle.css (edit and place in the theme's css folder).
    • Dan Walker - Web Designer & Developer @ Top Webs Network
      Custom Joomla & Wordpress Websites
    • Tinetrix's Avatar
    • Tinetrix
    • Hero Rocketeer
    • Posts: 455
    • Thanks: 0
    • Love Rockettheme!

    Re: Tutorial - How to Add Custom CSS File

    Posted 11 years 11 months ago
    • Thank you so much! You are correct! :)
  • Re: Tutorial - How to Add Custom CSS File

    Posted 11 years 10 months ago
    • i tried the mycustomstyles.php on voxel on a windows 2008R2 server and it crashed the site's layout.
      How can that php file be modified for Windows?
    • Michael Stuart

Time to create page: 0.092 seconds