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; }
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.
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
and here is the CSS
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.
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.
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
}
What you need is the is_page_template feature
if( !is_page_template('prod-category.php')) { // show image
}
Thursday, 27 February 2014
Adding a Mobile Redirect to Wordpress
At present most of my changes to change the website display on mobile devices is through @media .
Which lead me to my first questions
can I use @media to force to new URL
how to put a url redirect in css
There is a well recommended plugin Equivalent Mobile Redirect
However I could get this to work on Wordpress 3.8.1
So I found this plugin which works fine Mobi Redirect
Which lead me to my first questions
can I use @media to force to new URL
how to put a url redirect in css
There is a well recommended plugin Equivalent Mobile Redirect
However I could get this to work on Wordpress 3.8.1
So I found this plugin which works fine Mobi Redirect
Thursday, 20 February 2014
Excluding a certain category when using Wordpress's have_posts function
Using Wordpress's 'have_posts' function is pretty darn cool. It fetches a list of your most recent post; the number of which is set in
Admin -> Settings -> Reading -> 'Blog pages show at most'
This array can then be iterated through thus
what I wanted to do is eliminate a certain category from being returned in the have_posts
and thought I could get away with something like
in the while statement to solve this. However this would change the number of posts I was displaying. Something I didn't want. The solution was to use query_posts which adds to the have posts function. It's not ideal in all situations but fine for what I was doing.
Wordpress Development Cornwall
Admin -> Settings -> Reading -> 'Blog pages show at most'
This array can then be iterated through thus
while (have_posts()) { // WP function that gets post the_post( );
what I wanted to do is eliminate a certain category from being returned in the have_posts
and thought I could get away with something like
foreach(get_the_category() as $category) { $cat_ID = $category->cat_ID; } if($cat_ID == '81' || $cat_ID == '82') {} else {
in the while statement to solve this. However this would change the number of posts I was displaying. Something I didn't want. The solution was to use query_posts which adds to the have posts function. It's not ideal in all situations but fine for what I was doing.
query_posts( 'cat=83&cat=84' ); if (have_posts()) {
Wordpress Development Cornwall
Subscribe to:
Posts (Atom)