Tag Info

Hot answers tagged

3

To add to the answer from @cristian.raiber, there is no function in Wordpress or php to detect screen sizes, and there will in all probabilty never be such functionality. Php runs server side, which runs before clients side which is browser side. As for php, and for that matter Wordpress, I cannot see any future implementation of any kind of function to ...


2

You will want to run a find-and-replace script across the database to update all URLs to reflect the new domain. Just because you change the WordPress settings doesn't mean the content stored in the database has been updated with the new domain! I've had good luck with the Velvet Blues Update URLs plugin but you can also do this type of find and replace ...


2

This is most likely due to differing line-heights and font-sizes between the editor, and the live site. You can try setting the vertical-align on the image (middle), or css position: relative, and setting bottom or top plus or minus a number of pixels. If you do this often, it would be easiest to define a css class and assigning the class to the images. ...


2

get_stylesheet_directory_uri() is a PHP function, you must use it in a PHP file instead of your CSS file. In your functions.php you can paste this code and change depends on your needs: function my_login_logo() { ?> <style type="text/css"> body.login div#login h1 a { background-image: url(<?php echo ...


2

I depends on your theme - they can be used for many things, but generally they are displaying in the list of the post, in the post itself (usually on the top of it). As well they are usually visible when sharing the link (for example in FB). But however, this is really pretty general question, you would have better to use google first (and maybe looking to ...


2

You could create a small plugin for this, here is an small example that will try to download and attach a file based on the url in the excerpt field for the post: add_action('publish_post', 'auto_featured_image_publish_post'); function auto_featured_image_publish_post($post, $post_id) { // check if this post is saved for the first time ...


1

This is a screencast from my WordPress 4.1 install: where the image width x height info is visible while we resize the images. This comes out of the box and no magic needed ;-)


1

No, there isn't such a thing at the moment. However, there is a solution you could try if you're really keen on this. This is something I've used in the past and it's worked out fine, although it has its limitations. The solution: You could write a small JS function that gets the user's current screen resolution and have it written to a cookie. You're ...


1

I'll give you a partial answer. In your first function you may use ucwords() PHP function: $alttitle = ucwords( str_replace( '-', ' ', $alt ) ); Second task is more complicated. I don't have a ready solution for you but the direction should be to extract attributes and values from HTML (playing with preg_match()), store them in variables and concatenate ...


1

Why do people use CMS? they use it to avoid having to handle HTML structure, JS and CSS on a page by page base and focus on the content. But if you do want to handle them that way because it save you time, then maybe wordpress is not the best solution for you. Wordpress has to know what is the content of the pages to be able to function properly and image ...


1

I'm guessing you're referring to images which have been placed into WordPress' post content editor, right? For example, you clicked "Add Media" and then uploaded a photo and inserted it into your post. What's hard to know is whether you're actually referring to a "Description" or if you mean the "Alt Text", "Caption" or "Title" fields. I have never seen the ...


1

Plugin idea #1 When we insert an image into the editor, the plugin automatically modifies the caption and the alt attribute to: [caption id="attachment_729" align="alignnone" width="300"] <a href="http://example.tld/wp-content/uploads/2015/02/wordpress.jpg"> <img src="http://example.tld/wp-content/uploads/2015/02/wordpress-300x284.jpg" ...


1

I believe your question is about creating a "favicon". This is a small image that is served up by your site and appears on each browser tab you may have opened. The WordPress Codex lists a convenient step-by-step on creating a favicon. http://codex.wordpress.org/Creating_a_Favicon Creating a Favicon A favicon can be created using any graphics/image ...


1

get_template_directory() Retrieves the absolute path to the directory of the current theme, without the trailing slash. You should use get_template_directory_uri(); for showing correct image path on site. echo get_template_directory();?/library/images/name_of_the_svg_image will work in your case. Details here


1

Wordpress codex has the answer, its below. Set the image size by cropping the image and defining a crop position: add_image_size( 'custom-size', 220, 220, array( 'left', 'top' ) ); // Hard crop left top When setting a crop position, the first value in the array is the x axis crop position, the second is the y axis crop position. ...


1

No need for the filter. You can just call add_image_size later than the parent & it will overwrite.


1

Have look at add_image_size and add to your theme's functions.php file: http://codex.wordpress.org/Function_Reference/add_image_size


1

By default an image belongs only to one post. Indeed that post is the parent post of the attachments (that are posts too). I think that the comment by TheDeadMedic is very good option because it is native to WordPress, but you can only link a post with one Featured Image. If you want to attach several files you can use the plugin WP Better Attachments ...



Only top voted, non community-wiki answers of a minimum length are eligible