Tuesday 25 March 2014

Horizontal Menu in Wordpress using CSS

Here's my CSS to solve showing a Wordpress Submenu Horizontally .  You'll need to use whichever tags you have in your menu.

 
ul.sub-menu {
left: 0;
margin-left: -340px;
min-width: 800px;
position: absolute;
z-index: 9999;
margin-top: -3px !important;
}

ul.sub-menu li {
display: block;
float: left;
position: relative;
width: auto !important;
}

.sf-menu li li{
background: none repeat scroll 0 0 #ffffff !important;
border-bottom: 1px solid #333333 !important;
border-top: 1px solid #333333 !important;

}

Having issue with making your YouTube Videos responsive.

I found some answers on google to the issue 'make Youtube embed responsive' but none of the replies fitted my website.  The issue here was that in some way the height was being forced shorted; meaning the display ratio was wrong.  To fix I've used a couple of div heights, that are Mobile dependent.  

In the youtube iframe I have both the height and width set to 100%.   And then applied an 'auto' width in the CSS.  its a css trick that seems to work.   ( all except ie 8 )


Next you need to wrap the embed code in a DIV .  like


div class="videoContainer"


and here is the CSS 

.video-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 30px; height: 0, overflow: hidden;
}   

.video-container ifram, .video-container object,  . video-

container embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}




Friday 21 March 2014

ERROR: Could not find a valid gem 'sass' <>=0>, here is why: Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

I received this error message while trying to install Sass on Windows 7 laptop. 

ERROR: Could not find a valid gem 'sass' <>=0>, here is why: Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

The issue is actually with  the Ruby Installer .  I found this out by searching 'ruby 2.0 gem install sass by http'  .  Check  http://stackoverflow.com/questions/21681817/cant-install-gems-on-windows-7-64

The solution then was to install Ruby Installer and roll back to an earlier version ( 1.9)

how to uninstall ruby installer ?  - I used 'Programs - Uninstall a program' found in Windows 'Control Panel' .

And then installed version Ruby 1.9.3.p545 instead from http://rubyinstaller.org/downloads/

Now after RESTARTING drush .  I can now run the command line gem install sass without issue.

Wednesday 19 March 2014

Wordpress Contact Form 7 Plugin not attaching email address

Here was the issue.  

On testing the form was sending fine.  However once switched to the customer the address of sender was not being attached.

The issue.  In   admin > contact > Contact Form  there is a tick box labelled 'Use HTML content type'  .  This may need to be un ticked. Once done then all recipients could receive the emails.

Thursday 6 March 2014

Wordpress - how to not display something in the header if template is X

What I had is a template that is displaying an featured image in the header .  However if the page is from a certain category I want to exclude this image from being show.


What you need is the is_page_template feature
 

if( !is_page_template('prod-category.php')) {

// show image

}