same page transparent intro - php

we are looking to place a semi-transparent welcome image on a clients Wordpress main index page, exactly like this http://www.editionsof100.com/.
I suspect this has been created using Jquery, would be possible to create something similar by adding to the CSS or index.php on WP?

This is quite simple, but pointless IMHO:
Create a div wherever you want the image located:
<div id="hello"><img src="http://tonkapark.com/projects/hello.png"></div>
Then you just use .fadeOut() on the element. Standard & simple jQuery
References:
http://api.jquery.com/fadeOut/
http://www.barelyfitz.com/screencast/html-training/css/positioning/

Have you tried using rgba values?
Example:
div { background: rgba(200, 54, 54, 0.5); }
If you need some animations, check out this cool css library which it is very easy to use.
enter link description here

Related

How to customize/style woocommerce account page

As you can see here: https://wildlatina.com/my-account/
the white body is not inside the page and there is not margin padding for the login form? what did I do to mess this up? I'm a beginner when it comes to editing with css so please go easy on me. Just would like the account page to look nice.
hi please login to your cpanel or ftp then open your theme style.css
find the css rule below
.full-width-content .container.grid-container {
max-width: 100%;
}
and comment the rule like this
.full-width-content .container.grid-container {
/*max-width: 100%;*/
}
and it will look like this
You have used the Wordpress theme GeneratePress. In that theme, if you have the class container and grid-container on an element, the width of that element is reset from 1080px to auto - which, in your case, means it fills the width of the page. So, your DIV with id "page" is changed from 1080px to the width of the page.
You should remove the container class from this DIV. You may then have to add some styles back to get the final effect you desire.
Hello You Can Style It By Using Some Plug-ins Which present at plug-ins>new one
for example you can go with this plug-in
https://wordpress.org/plugins/woocommerce-login-and-registration/
If You Cant Style It Please Post The Error You Are Getting Neatly And Most Probably You Can Use Wordpress Login For Woo-commerce But If You Are Really Interested To Use Only That You Can Customize It From CSS Or You Can Use Plug-ins Which Do The Same But No Coding Knowledge Required To Do It From Plug-in Because Everything is Graphically Done And whatever The Coding Part Is That Will Be Take Cared By Plug-in Itself So Maximum Use Plugins So It Could Better In Development
1) you can add this css add into theme or child theme style.css
.hfeed.site.grid-container.container.grid-parent{
width: 80%;
}
2) you can remove container class Here:
<div id="page" class="hfeed site grid-container container grid-parent">
my suggestion is second option is right

How to set random color box in wordpress theme

Good Morning, I am working on my wordpress web-page, which is made of image-boxes and they are changed to one-color background boxes with text on hover. See example here: http://www.top-news.6f.sk/.
I want make this boxes to have random color background or random color from list of colors.
I found out that the color of these boxes isnt set in .css file but its probably generated by some php file or function. (If u inspect source code you cand find that there is generated some css style inside, so if i put this code in my stelysheet.css it still wont work because it is overrided.
Can you give me any clues where to find a code where can i change the color of these boxes? Then I would be able to rewrite it to random color.
Thanks
If you want to override inline styles, in your style.css, use !important.
Similar to :
background-color: #fff !important;
If you want to create a random background color
<?php $hex = dechex(rand(0,255)) . dechex(rand(0,255)) . dechex(rand(0,255)); ?>
and then you’d use the following in your body tag:
<body BGCOLOR=“#<?php echo($hex);?>”>

Thumbnail preview of a url using php and javascript

I have a need for getting preview a url over mouse hover, my application is built on php , js and jquery. Although I have an idea of to get to my requirements but am a little confused with the right approach, i checked all the posted question on here but most of them refer to some third party tools or installables. Frnakly i do not want to use them and think i should try one on my own. Please can you guide me through on the best possible step as per you?
Thanks!
11-Jun-2012
Finally I managed to use Curl and get a preview of the site on a Div placed next to the Link on my site, well now the problem is of fitting the content in the Div ..is there a way that I can adjust the css of the extracted html page in such a way that all the content fits in the fixed height and width of the Div.scaledown option or something? that would scale everything down to the required proportion?
You can do this, in plain ol' CSS and HTML:
.mouseover {
position:absolute;
width:200px;
height:200px;
top:5px;
left:5px;
display:none;
}
.link {
position:relative;
}
.link:hover .mouseover {
display:block;
}
Then, in HTML:
<a href="#" class="link">Link
<div style="background:url('<URL HERE>')" class="mouseover"></div>
</a>
Ok, so you want to get a thumbnail of a webpage and show it on mouse over. To do that, you'll need to either use tools that generate thumbnails or write a PHP script yourself. Here are some tools:
websnapr
Website Thumbnail Generator - This one you can install on your own server
If you want to write your own, check out imagegrabwindow. Note that it requires a Windows server. I don't know if PHP has any other methods to do this. If you're not on a Windows server, you could write a bash script to open a browser and use a screenshot utility to take a screenshot and save it to a file for your website to pick up.
You'll also have to make sure to have some sort of cache so you're not doing this every time every user moves their mouse over a link.
You can use urlbox.io for this, here's an example preview thumbnail of this very URL:
https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/32040df25d7c57da28ef4da7ce461af00d852653/png?url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F10970647%2Fthumbnail-preview-of-a-url-using-php-and-javascript&thumb_width=400
You can see that the options passed into the Urlbox API are simply url, and thumb_width to set the desired width of the thumbnail in pixels, in this case I chose 400 pixels wide.
Now all you got to do is embed it in an <img> tag like so:
<img src="https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/32040df25d7c57da28ef4da7ce461af00d852653/png?url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F10970647%2Fthumbnail-preview-of-a-url-using-php-and-javascript&thumb_width=400"/>
You can use API to do this. For example ApiFlash has a free plan that you can use up to 100 screenshots per month.
Here is how it would look like with PHP:
<?php
$params = http_build_query(array(
"access_key" => "YOUR_ACCESS_KEY"
"url" => "https://example.com",
));
$image_data = file_get_contents("https://api.apiflash.com/v1/urltoimage?" . $params);
file_put_contents("screenshot_api_example.jpeg", $image_data);
?>
The API has a very good uptime because it's based on AWS Lambda.

How to have random image each refresh for one style sheet, but go away upon choosing another stylesheet?

I'm currently working on my own Wordpress theme. I thought it'd be cool to have a dropdown box in the sidebar in which you can choose different themes, and it'll change the page background, border colors, etc a bit.
The thing is, for one theme (the default one) I have Javascript in my header.php file where the header image will change each refresh. I want this header image to go away when switching stylesheets, but it just overlaps the other one. How do I change this?
If you want to see for yourself, the box is in the right sidebar under the blue buttons. This is my testing website. Ignore the 000webhost stuff.
http://trainman1405.site11.com/wordpress/
Thank you!
The general solution here is to define all of your styles in one sheet, but namespace them so you can simply change the class on the body and the new styles will take effect. (You could also define them in separate sheets, using the namespaces, and simply reference every sheet in your <head>.)
For example, some CSS:
body a { color: #00f; } /* default */
body.green a { color: #090; }
body.red a { color: #f00; }
And then when you want to change it (using jQuery, although plain Javascript could do this job too):
$('#theme_select').change(function()
{
$('body').removeClass('green').removeClass('red'); // remove existing classes
$('body').addClass($(this).val());
});
it looks like you could use a javascript library its called jquery. You could use that to hide and display a new image e.g
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.js"></script>
<script type="text/javascript">
function piczotheme() {
$("defualttheme").hide()
$("mountaintheme").hide()
//and then show load add your picture
$('#defualt').css("background-image", "url(url of the picture)");
}
</script>
and then you have to set up a button or something to trigger this effect
so...
<button onclick="piczotheme()"> click </button>

display tooltip on hover over text

How would I go about displaying a tooltip when the user hover overs some text? These text are keywords. I don't want to manually add these tooltip for each keywords. I am looking for a way to create a script of some sort to automatically do this either on the client side or server-side. When a user hovers over these keywords, and if the keyword exists in the database or an array it should retrieve the information from the database.
Please let me know if there are any good tutorials available on how to solve this problem.
There are many useful plugins to create nice tooltips.
I know two of them that use the jQuery framework:
mb-tooltip: [http://pupunzi.open-lab.com/mb-jquery-components/mb-tooltip/]
jquery-plugin-tooltip: [http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/]
You have to surround your keywords with a span element and a class to apply the jQuery selector.
Maybe it's preferable to query for keyword presence server-side creating the ad-hoc html code for displaying the right tooltips, otherwise you have to create a tooltip in an AJAX way, handling the mouse hover event on the keyword.
You can also use YUI as an alternative to JQuery plugins. Here there is an example of what you want to do Simple Tooltip Example with YUI
You might consider using the HTML Global title Attribute. If you're looking for something simple that's already built in to HTML (and thus usable in PHP without addins) then that would be my go-to solution. I'm considering it's use in a project myself.
Use the jQuery tooltip plugin, which can be found here.
Code looks like:
$("img[title]").tooltip()
There is a very popular Jquery Plugin "Beauty Tips" for this:
http://www.lullabot.com/files/bt/bt-latest/DEMO/index.html
Example of Beauty Tips with options:
$('#example3').bt({
contentSelector: "$(this).attr('href')",
fill: 'red',
cssStyles: {color: 'white', fontWeight: 'bold'},
shrinkToFit: true,
padding: 10,
cornerRadius: 10,
spikeLength: 15,
spikeGirth: 5,
positions: ['left', 'right', 'bottom']
});

Categories