Category Archives: Wordpress

Echo Current Year in Copyright

When adding copyright information it is generally a good idea to render the copyright year dynamically. This can be done in many ways, here are 2 most common:

1st way

© 2012. – 2013.

© 2012. - 

2nd way

© 2012. – 2013.

© 

The second way is better when building new websites, since the output will automatically change next year from © 2013. to © 2013. – 2014. if $copyYear is set to 2013.

© 

WordPress head meta tags, scripts, links showing up inside body tag (Header appearing in body tag)

Sometimes in WordPress the header tags and links start appearing inside the body tag.


 
 
 
   "
    "
  meta tags and stylesheets
  the content
 

This problem generally occurs due to specific encoding of the file. We need to change the file encoding from UTF-8 to “UTF-8 without BOM” (BOM=”byte-order-mark”) and save it again. We can use Notepad++ as it allows us to specify the encoding we want to save the file in.

To change the default encoding for new and/or opened documents in Notepad++ go to Settings -> Preferences -> New Document/Default Directory and under encoding select “UTF-8 without BOM” and select “Apply to opened ANSI files” as well.

notepad-plus-plus-default-encoding