WordPress v 3.0.4 multisite-network enabled, local installation w MAMP 1.9.4, PHP 5.3.2, Theme: Twentyten child
TWO PROBLEMS: 1) Display of header image thumbnails in admin panel and 2) path to favicon.ico for child theme (used for main site at root) – both defined in the functions.php file inside child theme folder.
Created ‘functions.php’ file in child theme folder, implementing code by David Cox of Digital Raindrops, as posted up at digitalraindrops.pastebin.com/B3mPW3RD, with slight modification to allow for calling favicon, also to allow for second menu.
It does work – the image thumbprints are showing up, and I can select them; HOWEVER, the display is wonky. In the admin panel under âHeaderâ | Default Images, immediately below the text âIf you donât want to upload your own image, you can use one of these cool headersâ, there is a lone radio button, and beside it and slightly stepped down, a row of 2 header image thumbprints Iâm using, and then to their right, slightly stepped up (on the same level with the first radio button on the far left), two more radio buttons, beside the names of the images but without thumbprints. My description is perhaps confusing, and if you agree that a picture is worth a thousand words, take a look at imgur.com/AHmLQ.png.
Shall I paste the code here? Warning: it’s long, and I’ve already pasted it over at wordpress.pastebin.com/wMmTF1Zc.
Sorry, this is a local installation, so no link to my website.
If anyone can help spot what Iâm doing wrong, will really appreciate it.
Oh – and I’m having trouble with the path to the favicon.ico. The image is located in wp-content/themes/twentyten-child-main/images/. The code is placed at the top of the functions.php file:
<?php
/** Twentyten child theme: twentyten-child-main */
function favicon_link() {
echo ‘<link rel=”shortcut icon” type=”image/x-icon” href=”/wp-content/themes/twentyten-child-main/images/favicon.ico” />’ . “n”;
}add_action(‘wp_head’, ‘favicon_link’);
After removing the .DS_Store file from the images/headers folder, the Header admin panel is displaying the header image thumbnails perfectly!
And yes, it is important to remove .DS_Store files before migrating the site to live server, or they will hitch a free ride and end up on the server.
So Mac users, pay attention. To remove .DS_Store from any folder, open Terminal and navigate to the folder.
cd path/folder/ (example: cd Documents/ followed by cd Websites/ followed by successive folders all the way to the child theme’s ‘images/headers’ folder)
ls -al (displays all files, including . and .. and .DS_Store)
find ./ -name “.DS_Store” -depth -exec rm {} ; (removes .DS_Store from this directory and all subdirectories)
Now the code from David Cox over at Digital Raindrops is working beautifully – allows for locating header images in the child theme’s folder, where they will not be vulnerable to overwrite – AND – also generates the display dynamically – no need to manually add to array every image you create; simply create header images and thumbnails and save to the folder designated in the code. 🙂
Found the answer to the 2nd problem. Inside functions.php, at top:
But having no luck finding the solution to 1st problem. 🙁