{"id":1139,"date":"2014-09-17T14:03:37","date_gmt":"2014-09-17T14:03:37","guid":{"rendered":"https:\/\/docs.wpgeodirectory.com\/?p=1139"},"modified":"2017-12-31T11:28:17","modified_gmt":"2017-12-31T11:28:17","slug":"customizing-your-style","status":"publish","type":"post","link":"https:\/\/wpgeodirectory.com\/docs\/customizing-your-style\/","title":{"rendered":"Customizing your style"},"content":{"rendered":"<p>This article explains how you can create new CSS rules to change the style of your site.<\/p>\n<p>Most browsers have a built-in <strong><em>code inspector<\/strong><\/em>, for example FireFox has Firebug, Internet Explorer and Chrome have Developer Tools.<\/p>\n<p>For the example below, we will use Chrome&#8217;s Developer Tools to change the footer background color on the <a href=\"http:\/\/wpgeo.directory\/\" target=\"_blank\">GeoDirectory Demo<\/a>.<\/p>\n<ol>\n<li>Open the Chrome browser to the <a href=\"http:\/\/wpgeo.directory\/\" rel=\"noopener\" target=\"_blank\">web page<\/a> where we want to change the style of an element.<\/li>\n<li>Right click on the footer area element we want to change [Step 1 in the image below &#8211; we are right clicking on the footer].<\/li>\n<li>From the pop-up menu, choose<em><strong> Inspect element<\/strong><\/em>. If the\u00a0<em><strong>code inspector<\/strong><\/em> is not open yet, it will open.<\/li>\n<li>If the element is not highlighted yet, we click on it to make sure it is [Step 2 and 3 &#8211; highlight the footer style].<\/li>\n<li>We can continue to select &#8216;Inspect&#8217; until the element we want is highlighted in the code[Step 4 &#8211; in this case it shows that the <em><strong>footer<\/strong><\/em> class has a background color specified].<\/li>\n<li>The <em><strong>code<\/strong><strong> inspector<\/strong><\/em> will also show you in which file you can find the code [Step 5].<br \/>\n<i class=\"fa fa-lightbulb-o fa-2x\" style=\"color: green;\"><\/i> <span style=\"color: #008000;\">Turn off GD Booster before checking your CSS.<\/span><\/li>\n<li>The CSS code is displayed, and we click on the rule to change the background color; double click starts the editing. In this case we will change the background color to red [Step 6 in the second image].<\/li>\n<li>If the CSS code is correct, the web page will adjust to show your change [The footer is now red].<\/li>\n<li>Use the mouse to highlight the CSS code and copy it to your clipboard; proceed to add it to your site. You can add custom CSS to GeoDirectory at <strong><em>GeoDirectory > Design > Scripts > CSS Custom Code<\/strong><\/em>, or use anotherplugin or even add that code to the stylesheet of your child theme at <em><strong>WP Admin &gt; Appearance &gt; Editor<\/strong><\/em> and locate <em><strong>style.css<\/strong><\/em> in your child theme.<\/li>\n<li>Add the code <code>.footer {background-color:red;}<\/code>, and save. That will update your site.<\/li>\n<\/ol>\n<p><img src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2014\/09\/css0.png\" alt=\"\" \/><\/p>\n<p><img src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2014\/09\/css1.png\" alt=\"\" \/><\/p>\n<h4>Hints<\/h4>\n<ul>\n<li>You can add &#8220;!important&#8221; if your style rule doesn&#8217;t seem to have an effect. &#8216;!important&#8217; will raise the priority of the rule if it conflicts with other rules. Example:<br \/>\n[css]<br \/>\n.footer {background-color:red !important;}<br \/>\n[\/css]<\/li>\n<li>The code inspector will provide you with valid auto-complete suggestions as you type. Choose one, or two, and try them out until you become comfortable with the editor.<\/li>\n<li>See it in action on <a href=\"https:\/\/www.youtube.com\/watch?v=9oYhq84ZqaE\" rel=\"noopener\" target=\"_blank\">Youtbe by WPBeginner<\/a>.\n<li>Set a reminder on your calendar to backup your custom styles by copy\/paste into a file every month. If you need to uninstall GD temporarily, don&#8217;t forget to make a copy of the Scripts you store in this location.\n<\/ul>\n<h4>How to add CSS, PHP, and Javascript Snippets to your site<\/h4>\n<ul>\n<li><strong><em>CSS<\/em><\/strong> &#8211; Add CSS to the GeoDirectory Design Admin Panel called Scripts. Navigate to <em> YourSite > GeoDirectory > Design > Scripts > Custom Style CSS Code<\/em><\/li>\n<li><strong><em>PHP<\/em><\/strong> &#8211; Add PHP Snippets to your site with the <a href=\"https:\/\/wpgeodirectory.com\/docs\/useful-plugins\/#snippets\" rel=\"noopener\" target=\"_blank\">Code Snippets<\/a> plugin, a Very lightweight plugin that makes it easy to manage your custom code, and keeps it all in one place even if your plugins or themes get updated. There is a special case for &#8216;constants&#8217;, values that apply sitewide. These are PHP Snippets that start with &#8216;define&#8217; like <em>define(&#8216;SD_DEFAULT_FEATURED_IMAGE&#8217;, &#8220;http:\/\/yourdomain.com\/images\/featured.jpg&#8221;)<\/em>. Constants should be added to your site&#8217;s wp-config.php file.\n<li><strong><em>Javascript<\/em><\/strong> &#8211; You may never need this, but if you do need to add a Javascript snippet, add it to <em> YourSite > GeoDirectory > Design > Scripts > Header Script Code<\/em> or Footer Script Code, depending on the instructions you receive with the snippet.<\/li>\n<\/ul>\n<h4>Useful resources<\/h4>\n<table border=\"0\">\n<tbody>\n<tr>\n<td>Using child themes<\/td>\n<td><a href=\"http:\/\/codex.wordpress.org\/Child_Themes\" target=\"_blank\">http:\/\/codex.wordpress.org\/Child_Themes<\/a><\/td>\n<\/tr>\n<tr>\n<td>CSS tutorial<\/td>\n<td><a href=\"http:\/\/www.w3schools.com\/css\/\" target=\"_blank\">http:\/\/www.w3schools.com\/css\/<\/a><\/td>\n<\/tr>\n<tr>\n<td>Using FireFox Page Inspector<\/td>\n<td><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Tools\/Page_Inspector\" target=\"_blank\">https:\/\/developer.mozilla.org\/en-US\/docs\/Tools\/Page_Inspector<\/a><\/td>\n<\/tr>\n<tr>\n<td>Using Chrome Dev Tools<\/td>\n<td><a href=\"https:\/\/developer.chrome.com\/devtools\/docs\/elements-styles\" target=\"_blank\">https:\/\/developer.chrome.com\/devtools\/docs\/elements-styles<\/a><\/td>\n<\/tr>\n<tr>\n<td>Using Internet Explorer F12 developer tools<\/td>\n<td><a href=\"http:\/\/msdn.microsoft.com\/library\/ie\/bg182326\" target=\"_blank\">http:\/\/msdn.microsoft.com\/library\/ie\/bg182326<\/a><\/td>\n<\/tr>\n<tr>\n<td>SiteOrigin CSS Plugin<\/td>\n<td><a href=\"https:\/\/wordpress.org\/plugins\/so-css\/\" target=\"_blank\">https:\/\/wordpress.org\/plugins\/so-css\/<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>This article explains how you can create new CSS rules to change the style of your site. Most browsers have a built-in code inspector, for example FireFox has Firebug, Internet Explorer and Chrome have Developer Tools. For the example below, we will use Chrome&#8217;s Developer Tools to change the footer background color on the GeoDirectory &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/wpgeodirectory.com\/docs\/customizing-your-style\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Customizing your style&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1676,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[15],"tags":[],"amp_validity":null,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/posts\/1139"}],"collection":[{"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/users\/1676"}],"replies":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/comments?post=1139"}],"version-history":[{"count":0,"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/posts\/1139\/revisions"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/media?parent=1139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/categories?post=1139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/tags?post=1139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}