How do I get dashicons to work in a WordPress meta box? I want to do something similar to the calendar icon that is in the "Publish" meta box next to "Published on".
I have no trouble at all using them as the icon for the custom post type and in the "At a glance" on the dashboard.
This is what I am doing:
#time_control_area #expire:before {
content: "\f235";
top: -1px;
}
And this is my result:
I have tried to enque the dashicons styles which has not worked. I cannot find good documentation anywhere on how the dashicons work with WordPress.
Inspecting the back end of one of my sites, the styling for each of the :before tags that show the WP-default icons seems to be hard coded into wp-admin\load-styles.php.
It looks like you'll need to manually add font: 400 20px/1 dashicons; and possibly some of the other rules to your css to get this to work. Alternately, you could try applying one of the classes WP uses your menu item.
Full css I see for the WP-default icons:
#post-body #visibility:before, #post-body .misc-pub-revisions:before,
.curtime #timestamp:before {
font: 400 20px/1 dashicons;
speak: none;
display: inline-block;
padding: 0 2px 0 0;
top: 0;
left: -1px;
position: relative;
vertical-align: top;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-decoration: none!important;
}
Related
I'm trying to hack a search box into a wordpress mobile nav menu and I have no idea why I can't type into it. I'm guessing the issue is related to the cursor but can't find more info on how to fix it and I seem to have reached the limits of my abilities!
Thanks for your guidance :)
Edit (forgot the link): https://www.winebounty.com (mobile version)
Based on the link, my assumption was incorrect. You are able to type into it, and it's not being blocked by another element. The issue is with the font size, it's set to 0px. I found this out by opening up Chrome Dev Tools, and clicking on Computed that shows all styles that are applied to that element.
In your style.css you have the following on line 48999:
input, button, select, textarea {
font-family: inherit;
font-size: inherit; /* <-- Culprit */
line-height: inherit;
}
It's inheriting the font-size from line 13922:
#mega_main_menu, #mega_main_menu>.menu_holder,
#mega_main_menu>.menu_holder>.menu_inner,
#mega_main_menu>.menu_holder>.menu_inner>.mega_main_menu_ul {
font-size: 0; /* <-- This guy */
letter-spacing: 0;
word-spacing: 0;
line-height: 0;
display: block;
visibility: visible;
overflow: visible;
-webkit-backface-visibility: hidden;
}
You just need to add an appropriate font-size to that search input, and it will work, as seen here:
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:
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.
This problem exists ONLY on Mac Safari.
Other browsers / other OS works properly.
The problem:
Observe the font weight of the top navigation here: http://www.octa.com (WordPress)
Then observe the font weight of the top navigation here: http://www.octa.com/products (Magento)
Note that while they are served by different code (WP vs Magento), the css is nearly identical between the two pages.
Here's the relevant bits of the css:
nav.menu li a {
font-family: 'VegurLight','Myriad Pro',Arial,Helvetica,Sans-Serif;
font-size: 20px;
text-align: left;
}
nav.menu li a, #subnavwrapper nav li a {
color: #FFFFFF;
font-weight: normal;
height: 50px;
line-height: 50px;
padding: 0 46px 0 0;
}
nav li a {
display: block;
line-height: 1em;
text-decoration: none;
}
body {
color: #000000;
font-family: "Lucida Grande","Lucida Sans Unicode",Helvetica,Arial,Verdana,sans- serif;
font-size: 14px;
line-height: 1.55em;
text-align: center;
background: black;
}
Note that the font is imported using #font-face.
I've tried everything - many answers here on SO and other articles. Note that none of the below styles gleaned from other answers / resources corrected the font display.
font-variant:normal;
-webkit-font-smoothing: antialiased;
text-shadow: rgba(0, 0, 0, .01) 0 0 1px;
Try -webkit-font-smoothing: antialiased;
I've found that this simple change made Safari's font-weight property much more reliable.
(I cannot post comments so I can only add my findings to the conversation by posting.)
I have found that text in fixed position elements appears lighter weight than other types of positioning in Safari. Therefore could not be ignored as suggested in other places.
Adding --webkit-font-smoothing: antialiased does solve this , but then it looks lighter than in Firefox. Which can be fixed with -moz-osx-font-smoothing: grayscale
fiddle here to show the problem - Safari only
With the comments / prodding from #JukkaK.Korpela, I discovered a few things:
First, the root of the problem is this:
-webkit-backface-visibility: hidden;
Which was added to the code to solve an animation problem per this answer: iPhone WebKit CSS animations cause flicker
Don't know how to solve the font and solve the flicker, but I can at least choose which one to solve now.
Second, as an avid Firefox/Firebug user, I had tried using Firebug Lite in Safari, as well as another extension for Safari, and they did not work. So, for all of you out there who may be trying to troubleshoot Safari-only issues, here's a big tip:
Safari's "Develop" tool. Didn't know about it at all until I did some searching today, but it's a menu item in the toolbar. If you don't see it, then go to Preferences->Advanced, and check the "Show Develop Menu in Toolbar"
With that tool, I was able to troubleshoot and solve this quickly.
my asp buttons are getting blurred after disabling them through code in Internet Explorer.on mozilla it is working fine.
Css applied to buttons are
.Login-btn{
font-family: Tahoma;
font-size: 12px;
font-weight: bold;
color: #FFFFFF;
background-image: url('../images/Login-btn.jpg');
background-repeat: repeat-x;
padding-right: 20px;
padding-left: 20px;
display: block;
width: auto;
float: left;
text-decoration: none;
margin-left: 10px;
}
Login-btn.jpg is blank image on which i am writing text.what can be the problem
Well, IE gives a disabled effect to html buttons ignoring whatever CSS that you may have. So there are no real solutions but few work-arounds:
Instead of disabling button, add a onclick handler that would return false (but button will still remain click-able).
Create your own custom button implementations that rely on hyper-links
You should create a separate style selector for disabled buttons, something like this should work across most browsers, even IE (7+):
.Login-btn[disabled="disabled"], .Login-btn.disabled{
}
see: this link