Assign one featured image to multiple posts?

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

How do I embed youtube video via url in frontend posting

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

Custom styling Insert Media window

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

Extract url from next_image_link

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

Display different Images depending on the current day

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

Remove the height limit on wordpress 3.4.2

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.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)