w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
background color to persist with defined
Wordpress: Calling featured image as background image with custom size
I don't know what your HTML is and I'm assuming you know how to run a CSS media query. I would suggest trying something like the following #featured img{ width: 80%; (or pixels if you prefer) } This will scale the image down to 80% width (and height) of any image within the featured div Please provide further code such as HTML or possibly your website. I can probably assist you a lot better.

Categories : CSS

How to use featured image as background image in wordpress
You can do it in this way by using css $background = wp_get_attachment_image_src( get_post_thumbnail_id( $page->ID ), 'full' ); <style> body{ background-image: url('<?php echo $background[0]; ?>'); } </style>

Categories : PHP

Dynamic and Responsive Wordpress Image on page based on Featured Image
<?php if ( has_post_thumbnail()) { $featureImage = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'feature' ); $featureImage = $featureImage[0]; ?> <div id="feature" style="background-image: url('<?php echo $featureImage; ?>')"> <? } else { ?> <div id="feature"> <? } ?> This is how I have accomplished this in the past.

Categories : PHP

Wordpress get featured image URL from category
Try this: <?php $slider_category_id = 123213; query_posts('showposts=1&cat='.$slider_category_id); if (have_posts()) : while (have_posts()) : the_post(); $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), array( 1680,470 ), false, '' ); ?> <div id="header-hero" style="background-image: url('<?php echo $src[0]; ?>');"> <?php endwhile; endif; ?> <?php wp_reset_query(); ?>

Categories : PHP

Adding featured image in wordpress.com via api
The media parameter in that API call is used only for uploading local image files, but you're calling it with an external URL. You should be using the media_urls parameter instead. Relevant bit from the documentation: media: An array of images to attach to the post. To upload media, the entire request should be multipart/form-data encoded. Multiple media items will be displayed in a gallery. Accepts images (image/gif, image/jpeg, image/png) only. Example: curl --form 'title=Image' --form 'media[]=@/path/to/file.jpg' ... media_urls: An array of URLs for images to attach to a post. Sideloads the media in for a post. Your code could change to: ... 'content' => http_build_query( array ( 'title' => $title, 'content' => $content, 'tags'

Categories : PHP

How to set wordpress automatically featured Image?
you can do with easily just upload image and it take image as featured image http://wordpress.org/plugins/simple-auto-featured-image/

Categories : Image

Can I add featured image to a page (WordPress)
you can get page thumbnail same as like post <?php /* * Template name: HomePage Template * Description: Homepage Template use to create your home page as a default view. * */ ?> <?php get_header(); ?> <div class="grid-12"> <?php//get page content and display ?> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <?//this will echo the page content ?> <?php if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it. the_post_thumbnail(); } ?> <?php the_content(''); ?> <?php endwhile; ?> <?php endif; ?> </div> <?//php get_sidebar(); ?> <?p

Categories : Wordpress

How do you upload image and set it as featured image on wordpress using C# metaweblog api?
I found the answer to the problem. XML-RPC alone cannot set any uploaded image to featured image. Head over to this issue page http://core.trac.wordpress.org/ticket/15098. The patch allows returning the ID information of the uploaded image when using wp.uploadFile/metaWeblog.newMediaObject. Once the image ID(not the image URL) is returned, you can set it to wp_post_thumbnail and it should appear as featured image. Another workaround without going this route is by uploading the image first and you should be able to retrieve the URL of the image. Query ID information from wordpress database table called wp_posts where image id is equal to the name of the image uploaded. From there, you can then set the ID to wp_post_thumbnail. Thanks a lot.

Categories : C#

wordpress get second featured image in slider thumbnail
Try this: if( class_exists( 'kdMultipleFeaturedImages' ) ) { $image_id = kd_mfi_get_featured_image_id( 'featured-image-2', 'page' ); kd_mfi_the_featured_image( $image_id, 'page' ); } Hope it helps!

Categories : PHP

Randomize array for wordpress featured image
This plugin/function appears to do what you are looking for, but in a slightly different way. Perhaps it will help. http://stcroixsolution.com/auto-feature-plugi/

Categories : Arrays

Wordpress Website Featured Image Replacement Issue
add the following: if ($thumb) { echo $thumb;} else { echo 'some other image here';} replace "some other image here" with a new query to get the alternative image. hope this helps?

Categories : PHP

Wordpress: Hide featured image thumbnail from gallery
All of these might help.. img{ width:0px; height:0px; display:none; visibility:hidden; } More then likely you should only use display none. You should also be using javascript to parse the php to html not php directly, This could leave a huge security flaw. Note that if you dont want the url to shown, encrypt the url.

Categories : PHP

Wordpress - uploading images to featured image isn't working
Have you deactivated all your plugins and tried? If you don't have any plugins set, I'm wondering if it could be a permissions issue, either in the uploads/ directory or an internal permissions error (example: you're not logged in as the admin, but in a different account with fewer privleges.)

Categories : PHP

Wordpress Displaying and Querying Posts with Featured image
Using this Query to get post title, content and futured thumbnail image: <?php $args = array( 'post_type' => 'post', 'posts_per_page' => 3, 'order' => 'asc' ); $query = new WP_Query($args); if ( $query->have_posts() ) { while ( $query->have_posts() ) { $query->the_post(); ?> <h1><a href="<?php echo the_permalink(); ?>"><?php echo get_the_title();?></a></h1> <?php if ( has_post_thumbnail() ) { the_post_thumbnail(array(486,226)); } echo the_content(); } } ?>

Categories : Wordpress

Wordpress Function to change existing featured image size
You should first use remove_action() or remove_filter() functions to remove the parent theme behaviour and then you can add the action of sub theme using add_action() . Here is a nice tutorial on How to Modify the Parent Theme Behavior Within the Child Theme for your reference.

Categories : PHP

Auto-place a featured image after x amount of paragraphs in WordPress?
Here's an example of how to do it: http://jsfiddle.net/tkK6y/ Let's say you have an array of image URLS: var imgs = ['1.jpg', '2.jpg', '3.jpg']; And a div with n paragraphs: <div id="theDiv"> <p>Foo</p> <p>Bar</p> ... </div> You can loop through every second paragraph and insert images after each one like this: var $div = $('#theDiv'); var $paragraphs = $('p:nth-child(2n)', $div); var n = 0; $paragraphs.each(function () { var $newImage = $('<img src="' + imgs[n] + '" />'); // Creates an img tag $newImage.insertAfter(this); // Inserts the img after the current paragraph n++; });

Categories : Jquery

Substitute "Featured" image on Archive.php category summary in Wordpress
Please check below link,hope this will help you ......... Wordpress get attached images wordpress get attached images 2

Categories : PHP

How to set youtube thumbnail from youtube embed code as featured image in wordpress?
The format for pulling the large image from a YouTube video is this http://img.youtube.com/vi/A4a0xZMMlqE/0.jpg just replace "A4a0xZMMlqE" with the video id. I think the easiest way to set this up would be to forget about using it as a featured image but just pulling it into the template dynamically. So in your post, make a custom field that will hold the YouTube video ID and in the template do something like: <img src="http://img.youtube.com/vi/<?php echo get_post_meta($post->ID,'youtubeId');?>/0.jpg"/> Does that solve your problem? Otherwise if you're looking at really making it the featured image then you're probably looking at developing a custom plugin: http://net.tutsplus.com/tutorials/wordpress/creating-a-custom-wordpress-plugin-from-scratch/ which will most lik

Categories : Image

Automatically contrasting text color based on background image color
You could do something like this. (using Colours.js and this answer) Note, this will only work with images on the same domain and in browsers that support HTML5 canvas. Javascript function getAverageRGB(imgEl) { var blockSize = 5, // only visit every 5 pixels defaultRGB = { r: 0, g: 0, b: 0 }, // for non-supporting envs canvas = document.createElement('canvas'), context = canvas.getContext && canvas.getContext('2d'), data, width, height, i = -4, length, rgb = { r: 0, g: 0, b: 0 }, count = 0; if (!context) { return defaultRGB; } height = canvas.height = imgEl.naturalHeight || imgEl.offsetHeight || imgEl.h

Categories : Javascript

Change font color based on the background image dominating color(in the text area)
may be create a table on top of your image. This way you can control the area of your text with a contrasting color and you can change you font to whatever you like. The image in the background can stay to whatever you like and I am assuming the image is in the body of your page. Anyways,this is I could think of for you and I hope it helps. I know colors and images are always hard and time consuming to get them set up. <table border="0" bgcolor="#00FF00"> <tr> <th>day</th> <th>Saving</th> </tr> <tr> <td>January</td> <td>something</td> </tr> </table>

Categories : PHP

Overlay a background-image with an rgba background-color
Yes, there is a way to do this. You could use a pseudo-element after to position a block on top of your background image. Something like this: http://jsfiddle.net/Pevara/N2U6B/ The css for the :after looks like this: #the-div:hover:after { content: ' '; position: absolute; left: 0; right: 0; top: 0; bottom: 0; background-color: rgba(0,0,0,.5); } edit: When you want to apply this to a non-empty element, and just get the overlay on the background, you can do so by applying a positive z-index to the element, and a negative one to the :after. Something like this: #the-div { ... z-index: 1; } #the-div:hover:after { ... z-index: -1; } And the updated fiddle: http://jsfiddle.net/N2U6B/255/

Categories : CSS

Cover background-image with transparent background-color
check this fiddle, i hope it helps. i added a div inside your body <div class = "overlay"> <div id = "name"> .... </div> <div> and set it's background color to background: rgba(0,0,255,0.5); where the last number is the opacity of the color new css .overlay{ background: rgba(0,0,255,0.5); margin: 0px; width: 100%; height: 100%; } you should remove the margins from the div.overlay and it will work I also updated the link P.S. you shouldn't set properties such as width and height and display to a div as it will affect all divs on the page and use classes instead of tag names to set those properties

Categories : HTML

Background image with a background color on hover
swap margin with padding and reposition the background image #navi .logo a { float: left; padding: 2px 10px; width: 36px; height: 26px; background: url(/imgs/navi/caul_white_nav.png) no-repeat; text-indent: -9999px; background-position: 50% } edit: just make sure to have the same background positioning on :hover as well

Categories : HTML

background-image not displayed if used also background-color
Try This code... element{ background-image:url(background.png.png); background-repeat:no-repeat; background-color:#242424; background-position: top center; } Use background-color property after background-image

Categories : CSS

background-image in wordpress
Inspecting the header element shows that the CSS for header.main-header is inline. This means, it is generated by WP and embedded into the page, not into a CSS file. Once generated, you can see the code by viewing the source of your blog page: <style type="text/css"> header.main-header { background-image: url('http://chuaquanam.ca/wordpress/wp-content/uploads/2013/08/cropped-TopMenu11.jpg'); width: 980px; height: 200px; } .. which is on line 67 onwards. The way for you to change your background-image is via the WP menu, if you select Appearance > Header, you can upload a new image, which will populate the width and height based on the image you upload. If you want to edit styling other than these properties (like positioning, floating

Categories : CSS

Different Featured Images for Non-Users on Wordpress?
AFAIK you cannot have more than one featured image per post. You can get an equivalent functionality using one of my favorite plugins, attachments, which lets you attach media library items to a post, to be accessed in your template files with php. Attachments: http://wordpress.org/plugins/attachments/ So for each post, you could give it a featured image, then also give it an attached image. Once you install attachments, you will have the option to attach items to a post on the standard post editing screen. Once you do that, some code like this should do what you want: <?php if (is_user_logged_in()) { //show featured image to logged in user the_post_thumbnail('thumbnail'); } else { //show alternate image to non logged in user, using the attachments plug in $attachmen

Categories : Wordpress

html background with image & color
That is nothing but a short hand syntax background: #f6b93c url(bg1.png); So the above code simply means background-color: #f6b93c; background-image: url(bg1.png); For more info on background short hand syntax Demo

Categories : HTML

css have a background color, text and an image in the same div
Do you mean this? .test { box-shadow: 3px 3px 5px darkGray; color: white; background: #e64e56 url(http://thumb10.shutterstock.com/thumb_small/536008/103572833/stock-photo-small-flower-isolated-on-white-background-103572833.jpg) no-repeat top right; } You can either define background-color, background-image, background-repeat and background-position separately, or use the shortcut background. When using the latter, it will overwrite the specific rules you have set, in this case background-color Here is the example, edited http://jsbin.com/axohoc/7/edit Here you can read up on the specifics of the shorthand property, as well as the different specific background properties: http://www.w3schools.com/css/css_background.asp

Categories : HTML

Access background image in Wordpress
You can use custom fields. If you don't know how to make them or you want an easy and robust way to manage them you can find the "Advanced Custom Fields" plugin in the wordpress.org plugin repository. It's free and it's very nice. The way you would use custom fields here is because you will set those backgrounds with inline style to your theme. Otherwise "the user" will have to know how to change a CSS line of code (not very practical). If you set them inline they would look something like this: <div id="divBackground01" style="background: url(<?php echo get_post_meta('$post->ID','div-bg-01',true); ?>);> </div> Another option that I've seen people do is make the CSS file in a PHP file... you would use something like: <style> #divBackground01 { backgr

Categories : PHP

use image in wordpress media as background
If you want you can disable the option to have them organized into the month and year folder by going to the Media settings. Otherwise, you can probably get the id of the file and then use the wp_get_attachment_image_src function to get it path. You can find more information about the function here

Categories : Wordpress

Allowing
background color/border-radius?
Set the background-color on the table element: table { border-spacing: 0; background-color: rgba(0,0,0,0.5); } td { border: 1px solid red; width: 75px; height: 50px; } http://jsfiddle.net/BnUU8/1/

Categories : HTML

Exclude a featured post from the Wordpress loop
You can use meta_query parameter, as explained in http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters Something like: $args = array( 'post_type' => 'any', 'meta_query' => array( array( 'key' => 'featured', 'value' => 'yes', 'compare' => 'NOT LIKE' ) ) ); $query = new WP_Query( $args );

Categories : Wordpress

jQuery Ideas for Featured Article on Wordpress
You can use bootstrap it offers some nice feature out of the box and is easy to use, once you download it you just do this to include it : <!DOCTYPE html> <html> <head> <title>Bootstrap 101 Template</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- Bootstrap --> <link href="css/bootstrap.min.css" rel="stylesheet" media="screen"> </head> <body> <h1>Hello, world!</h1> <script src="http://code.jquery.com/jquery.js"></script> <script src="js/bootstrap.min.js"></script> </body> </html>

Categories : Jquery

Android TextView Background Image With Color
I have a simple table layout, in the one of the row, I have time for sun rise in a text view and I am trying to have sun with purple colour for the row as background. How can I achieve this? Save your image in drawable folder , and in your TextView add this line : android:background = "@drawable/your_imagename_from_drawable_folder" I tried creating an image 1000px x 500px with sun and purple background, However, it does not look good on different screen sizes. What is the solution for this, any help would be greatly appreciated. ( This is not accurate answer but it will help you ) this online tool will help you creating images , http://labs.rampinteractive.co.uk/android_dp_px_calculator/ for this , first you have to find your emulator_dp and screen size and you can find it from emulat

Categories : Android

Change background color on image hover
The easiest way to do this is to wrap the img element in another, for example a span: <span class="imgWrap"> <img src="http://www.floral-directory.com/flower.gif" class="image" /> </span> And couple that to the CSS: .imgWrap { display: inline-block; border: 1px solid #000; } .imgWrap:hover { background-color: #000; } img:hover, .imgWrap:hover img { visibility: hidden; } JS Fiddle demo. And, if you'd like to make it a little prettier, using transitions to fade in/out: .imgWrap { display: inline-block; border: 1px solid #000; background-color: #fff; -moz-transition: all 1s linear; -ms-transition: all 1s linear; -o-transition: all 1s linear; -webkit-transition: all 1s linear; transition: all 1s linear; } .imgWrap

Categories : HTML

Background white color removing of .jpg image using css
CSS is not a tool that is capable of editing an image. It is a style sheet language which is used to describe the presentation of HTML elements in a web page. You can do that with any image editing tool like Photoshop. Still you can crop the image from the sides using CSS but i would not recommend it as the result may not be perfect because of rounded image of phone.(Image you posted) Before you ask a question, make sure that you at least know the basics of it else you will be downvoted to such an extent that you may not be able to ask further questions.

Categories : CSS

Setting a global background image or color in iOS
I solved the same issue with UIViewController categories that is in the common included file. So each UIviewController in its init function calls [self setMyColor]. This is my code: @interface ColorViewController : UIViewController - (void) setMyColor; @end

Categories : IOS

Text and background-color overlay on image
I made an example for you. http://jsfiddle.net/kb3Kf/2/ The main thing that was missing was that you gave the text an Absolute position but didn't give the wrapper a Relative one, like so: .img-overlay { position: relative; } It's really simple, you can take it to many directions. Tell me if that's what you wanted.

Categories : HTML

body background-image with color twist
For class left add float:left and height:100%. For class right add float:right. You can set the height for second according to your requirements.

Categories : CSS

Background color on block of text on top of image
Use position:absolute to .add_rating and position:relative to parent div Your CSS is pretty long and that is not really required so compress it like this .pu { display:block; width:185px; position:relative } .add_rating { position:absolute; bottom:0; left:0; min-width: 140px; background: rgb(255,255,255); color: #f00; text-align: center; display: none; margin-top: -30px; margin-bottom: 12px; width: 100%; min-height: 22px; } .pu:hover .add_rating { display: block; } DEMO

Categories : HTML



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.