Horizontal Navigation with Logo in Middle - css

I am creating a website on Wordpress and I would like to have a horizontal navigation menu in my header with the logo in the center as a link to the homepage. I have been able to create this look using the Wordpress menu, but when I look at the website on my phone the "home" link is situated in the center, which isn't how I would like it to be ordered.
Using the current template (HTML) is there a way to finagle the CSS so the nav menu looks similar to these guys: http://bostonscally.com?
Thanks!
#mpcth_page_header_content #mpcth_logo_wrap #mpcth_logo {
display:none;
}
#mpcth_page_header_content {
text-align: center;
padding: 0px 0px 0px 0px;
}
#mpcth_menu {
font-size: 18px;
font-weight: bold;
padding: 10px;
display: inline-flex;
}
#mpcth_menu .menu-item-166 > a {
position: relative;
background-image:url('/wp-content/uploads/2014/01/Bostin-Irish-Header_Woo.png');
background-repeat: no-repeat;
background-position: 0px 0px 0px 0px;
width: 300px;
height: 100px;
text-indent: -9000px;
padding: 0px;
}
#mpcth_page_header_content #mpcth_controls_wrap {
padding-right: 2em;
vertical-align: middle;
}

I recently answered a question similar to this.
It can be found here: How to add a custom item to a specific WordPress menu item position
There are 3 options as i said in the answer above.
jQuery, PHP or HTML/CSS and its down to what you are most comfortable with and if it is for a client, what they most prefer.
I would personally go with the PHP way and split the navigation in 2 and have the logo in the middle.
EDIT
So you'll need the jQuery version.
Your navigation will need to be setup with Home being the first element on the navigation. This will mean that the mobile version will have home as the first link.
Next you need to add the jQuery below underneath your inclusion of the jQuery library
jQuery(document).ready(function() {
jQuery("ul#mpcth_menu").find("li:contains('Home')").hide(); // hides home from navigation
var position = jQuery("ul#mpcth_menu li").length-1;
var i = 0;
jQuery('ul#mpcth_menu li').each(function() {
if(i == position/2) {
jQuery(this).after('<img src="http://www.bostonirishclothing.com/wp-content/uploads/2014/01/Bostin-Irish-Header_Woo.png" width="250" />');
}
i++;
});
});
This code removes the first element from the main nav, being the Home button, then figures out how many is left and places the logo into the middle.
You will also need to remove the CSS which adds the logo to the class menu-item-166 as this may cause problems.
Hope this fixes your problems.
DEMO

Related

QTabWidget - tab icons not in the center

I have a QTabWidget with six tabs, and all the tabs have an icon -
but the icons are not in the center of the tab:
What I've done so far :
tabWidget->setStyleSheet("QTabBar::tab {width: 40px; height: 40px;}"
"QTabBar::tab:selected {background: lightblue;}");
tabWidget->setIconSize(QSize(40, 40));
tabWidget->addTab("widget", QIcon("iconPath"), ""); //<--for all six tabs
And:
tabWidget->setTabIcon(index, QIcon("iconPath"));
Any ideas why this is happening, and how I can fix it?
I too have been struggling with this issue. Here is how I resolve it.
Background:
I was attempting to get a left side tab menu going, which used icons as its indicators (what the users would see), however I had a problem:
My icons, which were set using the currentTabIcon in the Property Editor, were aligning to the bottom (which is expected since I am using the West orientation. Normally, the North orientation would be selected and the icons would be on the left).
I had this as my stylesheet:
QTabBar::tab:hover {
background-color: #212121;
}
QTabBar::tab:selected{
background-color: #313131;
}
QTabBar::tab {
background-color: #111111;
height:70px;
width: 70px;
border: none;
}
Now, attempting the suggested solution found in this post whereby I set the margins did not have the desired effect, infact it had no effect at all.
Solution:
After playing around with some of the CSS properties, I discovered that setting the padding-top and padding-bottom gave me the desired result.
adding the lines:
padding-top: -15px;
padding-bottom: 15px
Resolved the problem for me, however this needs to be changed according to your needs.
My final stylesheet resembles:
QTabBar::tab:hover {
background-color: #212121;
}
QTabBar::tab:selected{
background-color: #313131;
}
QTabBar::tab {
background-color: #111111;
height:70px;
width: 70px;
border: none;
margin: 0px;
padding-top: -15px;
padding-bottom: 15px
}
If somebody has the same problem like me with the icons in the tabs, I found a solution after days and days search for this, and its so simple :D
Just add this to the stylesheet for the TabWidget:
tabWidget->setStyleSheet("::tab {margin: 0px;}");
************

Woocommerce buttons, grey area at bottom and filling entire screen

I have a number of issues with my woocommerce pages in my wordpress site that I am hoping someone could help me with. They have been driving me crazy trying to fix.
My theme - Trias - http://www.mojo-themes.com/item/trias-multi-style-corporate-responsive-theme/ does not support woocommerce and this has creatd issues.
First one is the woocommerce pages - category and product fill the entire screen i.e. right to the edge. Any idea how I would change this to be in line with my theme?
At the bottom of these woocommerce category and product pages - the theme ends and you can see grey area beneath the theme area - any ideas on how to prevent this.
Final query and this one is the most annoying - the theme has a floating icon on buttons i.e. a floating small arrow on the left of the arrow before the words start. Problem is on the woocommerce pages - the floating arrow floats above the words on the button. It is super annoying.
My themes button is as:
button,
a.button {
display: inline-block;
position: relative;
margin-top: 30px;
border: 0 none;
/* background: #00a3da url("images/button-link-arrow.png") no-repeat 0 50%;*/
padding: 7px 12px 7px 35px;
text-transform: uppercase;
color: #fff;
font-family: "Oswald";
font-size: 16px;
line-height: 20px;
cursor: pointer;
Please see image of the button with floating arrow: image of button with incorrect floating arrow
Thank you very much in advance for any suggestions at all
— U P D A T E D —
Add this CSS rules to the style.php file of your active child theme or theme
For your icon buttons :
.button.product_type_variable.add_to_cart_button,
.single_add_to_cart_button.button,
button.single_add_to_cart_button,
.button.wc-forward {
padding-left: 34px !important;
}
.button.product_type_variable.add_to_cart_button:before,
.single_add_to_cart_button.button:before,
button.single_add_to_cart_button:before,
.button.wc-forward:before {
top: 6px !important;
}
For your content (only woocommerce pages):
.woocommerce .content-wrap {
width: 934px;
margin: 0 auto;
padding: 20px 30px 20px 36px;
}
You will have to add custom media queries and adapt the values of this rules depending on target screen resolutions.
I think that you haven't set correctly your pages (regarding your theme), that's why you have this kind of "content" problems on woocommerce pages:
The best way to solve this kind of issue is to contact author's theme support threads, opening a ticket.

Using WP web scraper with WordPress

I'm trying to use WP Web Scraper plugin with WP in my site www.eastwickpark.co.uk to get online ratings of the practice from another site
https://www.iwantgreatcare.org/gpsurgeries/eastwick-park-medical-practice
I used this code snippet
<img src="http://www.eastwickpark.co.uk/wp/wp-content/uploads/2015/11/iwantgreatcarelogo.png" />
<div>
[wpws url="https://www.iwantgreatcare.org/gpsurgeries/eastwick-park-medical-practice" query=".image-middle" basehref="1" ]
</div>
Then I used custom CSS in the themes stylesheet editor
.btn.blue,
div .btn.blue {
font-size: 16px;
padding: 8px 16px;
}
/*** Stars ***/
.sprite-icons.star-blue-outline {
background-image: url('http://www.eastwickpark.co.uk/wp/wp-content/uploads/2015/11/star-blue-outline.png');
width: 19px;
height: 17px;
}
.sprite-icons.star-blue-fill {
background-image: url('http://www.eastwickpark.co.uk/wp/wp-content/uploads/2015/11/star-blue.png');
width: 19px;
height: 17px;
}
.sprite-icons.star-blue-half {
background-image: url('http://www.eastwickpark.co.uk/wp/wp-content/uploads/2015/11/star-blue-half.png');
width: 19px;
height: 17px;
}
.sprite-icons.caret-white {
background-image: url('http://www.eastwickpark.co.uk/wp/wp-content/uploads/2015/11/caret-white.png');
width: 10px;
height: 14px;
}
I've got a problem with my CSS in that the button "wraps".
Tried to just get the star rating targeting the class "raty-rating-wrapper-readonly" part but then I get a whole load of vertical stars.
i.e. if i use
[wpws url="https://www.iwantgreatcare.org/gpsurgeries/eastwick-park-medical-practice" query=".raty-rating-wrapper-readonly" basehref="1" ]
I get a whole vertical list of 5 * images?
If I use image-middle div like this
[wpws url="https://www.iwantgreatcare.org/gpsurgeries/eastwick-park-medical-practice" query=".image-middle" basehref="1" ]
I get a weird wrap on the button.
Can't figure this out, and have to admit I'm not a CSS guru. Any insight would be gratefully received.
I've got a problem with my CSS in that the button "wraps"
The cause of the wrapping behaviour is due to <br> tag dynamically generated by WordPress. You can either fix it by following the guideline here: Stop WordPress automatically adding <br> tags to post content
The above post is a plus for you because it also removes the <p> tags that are dynamically generated. I just browsed through your code and found a lot of unwanted p tags.
Can't figure this out, and have to admit I'm not a CSS guru. Any
insight would be gratefully received.
Since you hinted for a CSS solution, a simple fix is to hide the br tags using #widgets .textwidget br { display: none; }. Alternatively #widgets .textwidget a { display: inline-flex; align-items: center } fixes the space and aligns the arrow image as the br tag is ignored inside and initial direction of flex is row.
Unwrapped button:

Style Wordpress LOGIN widget

I am trying to find a way to style the default WP-login widget with some CSS. The problem though, is that no matter the selector or class that I use, I simply have 0 effect in the end.
I am aiming to remove the borders on the top, left and right; so only the bottom is left (like an underline), as well as put the 3 fields inline with eachother (username, password, sign in).
Anyone have an idea of what can be done?
Link to website in question: dev.melliandshayne.com
location of login: Currently I set it to the footer so it's easier to find. I would have it somewhere in the middle of the page at one point though.
Current theme: Ronneby Wordpress theme
Many many thanks!!
inspect the element with firebug or some sort of code inspector then you will be able to see the class/id that's applied to the element.
.widget.widget_crum_login form p.login-submit .button,
.widget.widget_crum_login form p.login-password input[type=password],
.widget.widget_crum_login form p.login-username input[type=text]{
border: none;
border-bottom: 1px solid #e0e0e0;
}
.widget.widget_crum_login form p.login-submit {
width: 100%;
}
This will align them side by side as requested...
p.login-submit, p.login-username, p.login-password {
float: left;
padding: 0 1em;
width: 33% !important;
}
.widget.widget_crum_login form p.login-submit .button, .widget.widget_crum_login form p.login-password input[type="password"], .widget.widget_crum_login form p.login-username input[type="text"] {
width: 100%;
}
.login-lost-password,
.login-remember {
clear: left;
text-align: center;
}

Change logo position in Joomla

I'e been using joomla default template: Protostar. From template manager I set a logo and it appears at the left top of each page. How can I shift the logo 100px right?
I'm running joomla 3.2.1 in localhost.
Go to the following file:
root/templates/protostar/css/template.css
Search for the logo and edit or add the following:
#logo {
position: relative;
left: 100px;
}
or on line 6936, you will find the .site-title { } block, which you can replace with the following:
.site-title {
font-size: 40px;
font-weight: bold;
left: 100px;
line-height: 48px;
position: relative;
}
In future, start getting used to your browser console and start inspecting elements. If you're using Firefox, then I would recommend using Firebug.

Resources