Some images don’t get linked when setting link-to to media-image
Some images don’t get linked when setting link-to to media-image
Some images don’t get linked when setting link-to to media-image
I’d suggest you check the $featuredimg URL. If there is already an attachment with this URL just get the ID and call update_post_meta( $pid, ‘_thumbnail_id’, $thumb_id ); There’s a useful function to get the ID for an existing URL: Philip Newcomer function pn_get_attachment_id_from_url( $attachment_url=”” ) { global $wpdb; $attachment_id = false; // If there is … Read more
WordPress supports quite a few embeds including YouTube since WordPress 2.9. To render anywhere, just pass your content through the_content filter and it should automatically convert the urls. $oembedContent = apply_filters( ‘the_content’, $basicContent ); If the defaults don’t meet your needs you can add an oEmbed-Enabled site using wp_oembed_add_provider( $format, $provider, $regex ) or add … Read more
You shouldn’t change core files this is bad practice and your changes will be overridden every time you update WordPress to the latest version. You can rather use the admin head hook (http://codex.wordpress.org/Plugin_API/Action_Reference/admin_head) in your themes functions file and override the styles. So it would look something like this… // Hook into the admin head … Read more
The function below is derived from adjacent_image_link() function. You can get both previous and next image source by this function. It can be used inside or outside loop. Uses // get next image src $src = wpse145194_get_adjacent_image_link(); // get previous image src $src = wpse145194_get_adjacent_image_link(true); Function function wpse145194_get_adjacent_image_link( $prev = false, $size=”thumbnail”, $post_id = false) … Read more
This is not an easy task and I don’t think it can be covered as a forum answer. You need to make sure that you know how to add metaboxes at post types and then how to use the media uploader of wordpress, plus plenty of javascript… If you are not familiar with metaboxes and … Read more
WordPress saves all images as a post type, called attachments. You will need to run a query to retrieve these attachments. You also need to specify which type of attachments you want to retrieve, as all attachments aren’t images. Videos, pdf files and audiofiles are also attachments, so you will need to specifiy the mime … Read more
You need to have the GD PHP5 Library installed. Alternatively the image crop sizes are all bigger than the images you are trying to upload. WordPress skips over these if that is the case. First check if you have GD installed and version. You can create a test.php file with this code below. Upload to … Read more
You can put all the related images in a specific directory. Let’s say the directory is grid_images and all the images have jpg extension. Then when you want to show the image, you can get the current day of the month and pull the image accordingly. $image = PATH_TO_GRID_IMAGES_DIRECTORY . date( ‘j’ ) . ‘.jpg’; … Read more
There is no height limit in WordPress, however your theme may have set the Content Width to 950, so the limit is there on the width in the theme. This limit prevents you from inserting an image wider than the available space for it on the page.