Divi Theme: Add Copyright & Add Social Icons to Footer

[et_pb_section admin_label=”section”][et_pb_row admin_label=”row”][et_pb_column type=”4_4″][et_pb_text admin_label=”Text” background_layout=”light” text_orientation=”left” use_border_color=”off” border_color=”#ffffff” border_style=”solid”]

Here’re a couple of Divi Theme tips & tricks:

[/et_pb_text][et_pb_text admin_label=”Text – Code – CSS Color Footer Social Media Icons on :hover” background_layout=”light” text_orientation=”left” use_border_color=”off” border_color=”#ffffff” border_style=”solid” module_class=”ourLilCodeSnippet”]

/* CSS Color Footer Social Media Icons on :hover */
#footer-bottom .et-social-facebook a:hover { color: blue; }
#footer-bottom .et-social-twitter a:hover { color: powderblue; }
#footer-bottom .et-social-linkedin a:hover { color: #1c87be; }
#footer-bottom .et-social-rss a:hover { color: orange; }

[/et_pb_text][/et_pb_column][/et_pb_row][et_pb_row admin_label=”row”][et_pb_column type=”4_4″][et_pb_text admin_label=”Text – JavaScript Footer” background_layout=”light” text_orientation=”left” use_border_color=”off” border_color=”#ffffff” border_style=”solid”]

Replace Divi’s footer shout out via JavaScript with a Copyright notice & also add a Social Media Icon (LinkedIn):

[/et_pb_text][et_pb_text admin_label=”Text – Code – JS Replace Divi stuff w Copyright in Footer + add LinkedIn icon” background_layout=”light” text_orientation=”left” use_border_color=”off” border_color=”#ffffff” border_style=”solid” module_class=”ourLilCodeSnippet”]

<script type=”text/javascript”>

/* replace Divi shout out w Copyright for My Company */

var theYear = new Date().getFullYear();
document.getElementById(‘footer-info’).innerHTML = ‘&copy; ‘+theYear+’ My Comany. All rights reserved.’;

/* Add LinkedIn Social Networking Icon */

jQuery(“#footer-bottom .et-social-icons”).append(‘<li class=”et-social-icon et-social-linkedin”><a href=”https://www.linkedin.com/company/the-dalai-lama-foundation” class=”icon”><span>LinkedIn</span></a></li>’)
</script>

[/et_pb_text][et_pb_text admin_label=”Text” background_layout=”light” text_orientation=”left” use_border_color=”off” border_color=”#ffffff” border_style=”solid”]

I’m using jQuery .append() to append the LinkedIn icon. You can choose other social media icons by using one from the approved list. You’ll find instructions on that page to create a Divi Child Theme, which you can modify to make these changes. Not sure why anyone would want to muck around w PHP, which might cause other issues if you’re not careful, when you can use JavaScript?

There are jQuery-less methods that are really easy if you’re using IDs for this, but a bit more challenging if you’re not… 😉

[/et_pb_text][/et_pb_column][/et_pb_row][/et_pb_section]

Let’s make the web faster – Google Code

Let’s make the web faster – Google Code.

Some choice excerpts:

CSS: Using every declaration just once

Using every CSS declaration only once is an effective way to reduce file size of style sheets. It’s not a trivial optimization technique though: Watch over the cascade and adjust your editing workflow.

HTTP caching

Web pages can load much faster on repeated visits if the resources come from the cache. Learn about two groups of HTTP headers that make all the difference.

Optimizing web graphics

Optimizing your web illustrations, icons, and graphics is one of the simplest yet most effective ways to decrease your page load time. In this tutorial, we discuss image file formats and optimize some real Google graphics for faster download on the web.

CSS Hacks and IE7

This is a really great article on how to hack IE7. CSS Hacks and IE7

  • The Child Selector
  • This selector uses a “>” symbol as a “combinator” that is placed between two parts of a CSS selector, and indicates that the target of the rule is the element on the right side of the “>” combinator, but only when that element is a direct child of the element to the left of the combinator. Thus, the selector table>td can never target any element, because TD’s are never direct children of tables, only of TR’s. On the other hand, the selector tr>td would select every TD on the page, since all TD’s are direct children of TR’s.

    The main difference between the Child combinator and the familiar space combinator is that the space combinator is a “descendant” combinator, meaning that the element to the right of the space only needs to be between the tags of the element on the left to be selected. So with the selector table td, all TD’s will selected, since TD’s always fall between the tag pair of one table or another.

    The Child combinator is quite useful for targeting rules to direct children of an element, without also targeting the more deeply nested descendants as well. Unfortunately, up until IE7 there was no point in using it for its intended purpose, since so few of the viewing public would get the benefits of the styling.

  • The Adjacent Sibling Selector
    • This selector is a “+” combinator symbol placed between parts of a selector, and is very similar to the Child combinator. The only difference between the two is that while the Child combinator points to direct children of an element, the Adjacent Sibling combinator points to an element which directly follows another element in the source.

      Thus the selector tr+td cannot select anything, because no TD ever directly follows a TR. Instead, TD’s are contained inside TR’s, and that is not considered to be “following” the TR. However, the selector tr+tr would select any TR that directly followed another TR, which means that every TR within a table would be selected except for the very first TR in that table.

      Get it? An adjacent sibling element not only follows its previous sibling, but is also completely separate from it. Further, if two DIV’s are in sequence and each contains a paragraph, those two paragraphs are not considered siblings, because they reside in different parent elements. The fact that one follows another means nothing unless the following sibling starts at the same point where the previous sibling ends.

  • Star HTML

Oh, you want to know about that structural thing? Well, the hack that uses it is called the star-html hack, and it works by taking advantage of an oddity in Explorer’s treatment of the Document Object Model, or DOM for short. Simply stated, all web pages start with a root element called html, which then contains two children, the head and the body elements. Those two then contain other children, and so forth.

  • Most browsers obey this arrangement, but Explorer for both Win and Mac do not. They seem to think there is a mysterious element enclosing the html element! It’s pretty strange, but in fact this extra outer “root” element has no apparent ill effects on web pages, and remained unnoticed for years, until Edwardson Tan began experimenting with CSS selectors. He found that a selector written as * html  .targetelement would apply the styles to .targetelement, but only for the IE browsers.

    Think about it. That star is the “universal” selector, so it points to any element, but it comes before html. Therefore, the full selector in effect says: “Select .targetelement when it is contained within html, and when html is contained within any other element”.

ALA’s New Print Styles + hasLayout

Perplexing little CSS issue that’s dogged me for ages: Why does MSIE have weird positioning some times? It could be because of hasLayout, and all you need to do, is apply position:relative to the CSS declaration:

A List Apart: Articles: ALA’s New Print Styles

The only little oddity here is position: relative. I included that because IE/Win has a tendency to make elements disappear if you pull them upward like this. The cure is to position them, which I suspect triggers the hasLayout flag. I don’t pretend to understand all the nuances of hasLayout, but recent information from Microsoft and third-party sources has shed quite a bit of light on the subject–it would appear that many of the layout problems that bedevil us in IE/Win are the result of an element not having hasLayout.

A couple of useful WebDev links…

I thought I’d post a couple of links to some WebDev sites & tools I use every day…

FireFox Extensions

Most of these are available on Mozilla’s Recommended Addons site.

  • Web Developer – Powerful Web Development tools for outlining DIVs, TABLEs, CSS, etc.
  • User Agent Switcher – change the User Agent on a site or page (pretend your MSIE 6 or 5)
  • Firebug – edit, debug, and monitor CSS, HTML, and JavaScript live in any web page…
  • GreaseMonkey – customize pages & sites by adding your own ‘user scripts’
  • AdBlock Plus – block ads & flash
    NOTE: If you need to show blocked ads (i.e., you need to see/test OAS ads -D ), there’s an ‘ABP’ button next to the Google search bar (looks like a red or green stop sign). Click the little disclosure triangle next to the ABP button, and choose ‘Disable on [site-url]’. If you need help, just ask!
  • FlashGot – File/Image/Link downloader
  • Fasterfox – page load timer (right-side of statusbar)

CSS Resources

  • AlistAPart.com – A great place for learning & pilfering^H^H^H experimenting with CSS techniques.
  • meyerweb.com/eric/css – Eric Meyer’s CSS site
    • CSS Edge – life on the edge!
    • …there’s much more here…
  • SelectORacle – a nifty online tool for learning how CSS2 & CSS3 selectors work
  • Rijk’s panelizer – adds W3C’s CSS & HTML specs to your Mozilla Sidebar
    • Just download the panelizer.zip, place it somewhere handy & unzip it. Then open the included ‘panelizer.html’ file, and click ‘Add Panel’. I created a ‘Sidebars’ bookmark folder in my Bookmark Toolbar, and placed the ‘bookmarks’ in there.

Mac Tools

NOTE: The following contains Mac-only tools. If you are afraid of Macs, or have aversions to heights, please close your browser now. This message will self-destruct in five seconds. Good luck team!

Need help with any of the above? Just ask!