header_image not working after site copy

It is not recommended to make a simple search&replace in the dump file when moving to another host, because of the presence of serialized data in some database fields (usually options fields of core and plugins). I would recommend to use one of the following migration plugins/scripts to handle the data conversion when moving WordPress: … Read more

Rotate images in header based on date

The following code will cycle between the 9 pics. 1st day of the year = pic0, 2nd = pic1…359th = pic9, 360th = pic0, etc. <?php $pic_array = array( ‘pic0’, ‘pic1’, ‘pic2’, ‘pic3’, ‘pic4’, ‘pic5’, ‘pic6’, ‘pic7’, ‘pic8’, ); $d = (int) date(‘z’) % 9; $todays_pic = $pic_array[$d]; echo $todays_pic; Hopefully you’re not changing a … Read more

Change a Page’s Header Image

The body tag has quite a few classes eg “home page page-id-### page-template page-template-template-name” you could make use of to customize the header with css. Just specify a different target: .home .header-wrapper { background-image: url(img/some-other-image.png); }

Multiple post image, echo url (path of image)

found the solution: <div class=”fill” style=”background-image:url(‘<?php $custom = MultiPostThumbnails::get_post_thumbnail_id(get_post_type(), ‘header-image’, $post->ID); $custom=wp_get_attachment_image_src($custom,’header image’); echo $custom[0]; ?>’);”></div>

Set a featured image as a replacement to the header image

You did not mention or shown in the code to which hook are you hooking the above code to, but here’s what I think should work. NOT TESTED global $post; $header_image=””; // featured image is first priority, right? if ( has_post_thumbnail( $post->ID ) ) { $header_image = get_the_post_thumbnail_url( $post->ID, ‘full’ ); } elseif ( !empty( … Read more

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