Home › Forums › Support › An alternative way to add custom css and backup/export/save it for another site
- This topic has 3 replies, 2 voices, and was last updated 8 years, 9 months ago by
Pete.
-
AuthorPosts
-
December 25, 2014 at 8:49 pm #57980
Pete
Install this plugin: https://wordpress.org/plugins/code-snippets/
Add a new snippet like this… (i’ve added my css as an example only)
Add your css between theecho '<style type="text/css">
and</style>';
tags// EXTRA Theme CSS function custom_css() { echo '<style type="text/css"> .textwidget.widget-text form select#cat.postform {margin-bottom:5px;} .entry-meta {display:none;} .entry-meta {color:#333;} .sidebar form select#cat.postform {font-size:14px;padding:5px;} .entry-content ul {margin:20px;} .entry-content ul li {list-style-type:disc;} .entry-content ul ul {margin:0px 0px 0px 20px ;} .entry-content ul li ul li {list-style-type:circle;} .entry-content ul ul ul {margin:0px 0px 0px 20px ;} .entry-content ul li ul li ul li {list-style-type:square;} .entry-content ul ul ul ul {margin:0px 0px 0px 20px ;} .entry-content ul li ul li ul li ul li {list-style-type:lower-roman ;} .entry-content ul ul ul ul ul {margin:0px 0px 0px 20px ;} .entry-content ul li ul li ul li ul li ul li{list-style-type:lower-alpha ;} .entry-content ul li.cat-item a {font-weight:400;} .entry-content ul li ul li.cat-item a {font-weight:400;} .widget ul {margin-left: 20px;} .widget ul li {list-style-type: disc;} .sidebar-font-size {font-size:87%;} .uwpqsf_class label {margin-left:10px;} .uwpqsf_class label input {margin-right:5px;} .widgets_on_page ul {margin-left:0px;} .widgets_on_page ul li {list-style-type:none; margin-left:0px;font-family: Open Sans;} .widgets_on_page ul li {padding:0px;} .widgets_on_page ul li ul {margin-left:0px;list-style-type:none;} .widgets_on_page ul li ul li {margin-left:0px;list-style-type:none;} .widgets_on_page ul li ul li ul li {margin-left:20px;list-style-type:none;} .widgets_on_page ul li ul li ul li ul li {list-style-type:none;} .widgets_on_page h4 {font-weight:700;margin:20px 0px 5px 0px ;border-top:dotted 1px #ccc;} .entry-content #browse.widgets_on_page ul li.widget.widget_taxonomy-drill-down {padding:0px;} #post-727 .entry-content {margin-top:0px;} </style>'; } add_action('wp_head', 'custom_css');
You can then export this code and css to an xml export file that you can import to another GP site 🙂
December 25, 2014 at 11:08 pm #57982Pete
Or I suppose you could just use Tom’s method in his signature and save it in a text file.
December 26, 2014 at 11:20 am #58081Tom
Lead DeveloperLead DeveloperThanks for the alternative way – this would definitely work.
Personally, I would prefer to use a child theme style.css or a plugin like my signature and save it in a text file, but the PHP method would work as well 🙂
Thanks for sharing!
December 26, 2014 at 11:26 am #58083Pete
Me too ☺
-
AuthorPosts
- You must be logged in to reply to this topic.