Action Hook Gone Rogue (in the Header Banner)
Help with an action hook gone awry,
Hello Graphene enthusiasts, and thanks for your attention and help. K.S., it is a winner and your efforts coding it and providing it to the wider world are much appreciated!
I’ve been crafting outreachecology.com and have been enjoying the graphene look until I had some ugliness happen with an action hook. The headers interface is broken, and at the moment I’ve got a rogue action hook image link that seems to be killing the banners and blocking the random selection of lovely pix from arriving. You can look at
and see that the banner is blank. In some browsers, you’ll see a missing image link in the banner; the source code for it is:
That image OElogobannerTEXT.png was used in the action hooks setting of a transparent logo floating on top of the banner, (following the instructions at: https://forum.graphene-theme.com/graphene-support/how-to-place-a-logo-in-your-header-with-rotating-images-underneath)
It worked, and was floating on top of the uploaded and cropped photos. But after installing a child theme, reinstalling WP core, and, of course, deactivating the action hook checkbox, I can’t get this link to a now-deactivated action hook to go away, and I cant get the photos banners beneath it to appear.
The order of the fight has gone something like this:
1) Upload a bunch of banners en masse through the graphene front end, enjoy pretty rotation through pictures
2) Overlay the OElogobannerTEXT image on the banner by graphene options->advanced->action hooks->header.php->graphene_header checked; then over to widgets to put a text widget with an img src on the newly appeared header widget area (instructions at https://forum.graphene-theme.com/graphene-support/how-to-place-a-logo-in-your-header-with-rotating-images-underneath to get the OElogobannerTEXT to overlay the photos)
3) Looks pretty, hooray!
4) Decide that the resolution for the image banners was too low, think about deleting all of the photos
5) not knowing about using media manager to delete the cropped_photobanner.JPG header media previously uploaded, decide to reinstall graphene with a child theme
6) create a child theme from original graphne, open up headers options, see original default selection of abstract banners, choose one for testing, go to main outreachecology.com page, and see the original OElogobannerTEXT image slapped onto the banner, but without the resizing that the original HTML text widget-> action hook widget box had caused. Strange…that means the link to this image is outside of the child theme.
7) Open up media manager and delete all of the uploaded banners from earlier, but cant find the OElogobannerTEXT file.
8) Using FTP, delete the OElogobannerTEXT following the URL in the source code of the web front page. Thats why theres a missing link for the banner, rather than the outsized image.
9) Remember about the action hook and uncheck it in Graphene Options. Still no correct banners, the missing link is still blocking the photo banners.
9.5) Reinstall wordpress core files.
10) Repetition of steps 6,7,and 9 until frustration sets in.
11) Multiple various pressins of “remove header image” and “restore header image” on the header options page, although its not exactly clear what these buttons do.
So, any ideas? Where is the change that this rogue action hook has performed? This error survived a child theme install, and a wordpress reinstall, so it can’t be in the /themes/graphene folder. The OElogobannerTEXT wasn’t visible in the media manager, either, so the offending img src link quoted above must be hiding somewhere else. Everything works normally on the headers options page. So maybe its hiding in the MySQL database….
I’m staggered, stumped, and confused.
Help! please, this action hook is gouging me!
AnonymousMay 28, 2012 at 7:53 pm #28801
Try replacing the file
includes/theme-head.phpwith the updated file here:Admin
There is no action hook in the your site’s header at the moment, as far as the page’s source HTML goes. You did mention deleting the outsized header image.
When stuck somewhere for an extended time, it’s often a good idea to start again.
So go to WP Admin > Appearance > Header, and click on the “Restore Original Header Image” button. That will revert your header image settings back to the default.
Check that everything is working as it should. If it does, upload your properly-sized header image using the same admin interface at WP Admin > Appearance > Header. Check again. All working? Upload more header images.
After the header images have been uploaded and are rotating properly, enable the header widget area, and place your logo in there. The positioning of the logo might need some work, but we’ll get to that when you’ve sorted out the rotating header images.
Hello, thanks for your input.
I forgot to mention that these troubles did begin just after the 1.7.1 upgrade. Sorry, that is a significant fact, I’m sure!
-Josh, I followed your advice, which I believe rolled back theme-head.php to 1.7. At first glance, nothing has changed…
-Syahir, thanks for chiming in. (You’ll likely enjoy hearing that many of the banner images that I’m trying to display are from a field trip to the Kauri forest at the Waitakere Forests, or from a lovely mural at a school just of K Road in Auckland.)
I’ve clicked the “restore original header image button”. The header screen preview updates and shows, properly, the flow.jpg banner. However, the problem remains on the front page, with the missing image link still there, and no sign of flow.jpg as an image or within the HTML source code.
I’ve also, for fun, tried “remove header image”…which blanks the preview screen and again makes no change on the frontpage. I’m not sure if it was intended to make the whole banner section disappear from the page layout…
The preview banner on the custom header page has always behaved properly (including randomly cycling through the previously uploaded images); it is only upon going to the actual frontpage that the banner doesnt show up.
I did also try retracing the steps where I enabled the action hook for the logo overlay, but it didn’t work and the long-ago-uploaded image link is still stuck there.
And to confirm, the only media manager files with the bold “header image” text flag are uploaded cropped*.jpg files. There is no sign of the long-since deleted OElogobannerTEXT.png file here.
Any other ideas? I can’t think of where this now-obsolete link would be hiding….or how it is managing to block the banner from functioning.Admin
I followed your instructions and it, hooray, shows the original flow.jpg as a banner. I looked at the page source and found there is still the text for that rogue PNG file, but it is now hiding a few lines below a a DIV class=<div class=”entry-content clearfix”>.
Following that, I went to the headers page, chose one of the uploaded photo banners, and it works as it should! So does random!
Great, that seems to fix it. Thanks muchly!
So what can we learn from it? That that file somehow got attached to the header as a featured image?
I do have a prime suspect:
There is a plugin hiding in there somewhere that automatically adds the first image as a featured image to posts:
“”Auto Post Thumbnail: Automatically generate the Post Thumbnail (Featured Thumbnail) from the first image in post (or any custom post type) only if Post Thumbnail is not set manually.””
Perhaps this was messing with the header banner?
And I’m not sure how this interacts with the v1.7 theme-head.php rollback; if I upgrade again or do a new child theme from the original 1.7.1 zip file, hopefully I’ll be able to check this box and fix it again in the future.
Thanks much, I truly appreciate it!AdminQuote:So what can we learn from it? That that file somehow got attached to the header as a featured image?
The theme has this feature that will automatically replace the header image with the featured image of the page currently being viewed, if the featured image dimension is greater than or equal to the dimension of the header image. This allows you to have specific header image for specific pages.
I suspect that you’ve assigned the previous lingering image as the featured image for the page that you use as the static front page, which was what causing the issue. It wasn’t an issue in the first place, just a feature that went unnoticed.Quote:“Auto Post Thumbnail: Automatically generate the Post Thumbnail (Featured Thumbnail) from the first image in post (or any custom post type) only if Post Thumbnail is not set manually.”
You don’t need a separate plugin as the Graphene theme is already doing this.Quote:And I’m not sure how this interacts with the v1.7 theme-head.php rollback; if I upgrade again or do a new child theme from the original 1.7.1 zip file, hopefully I’ll be able to check this box and fix it again in the future.
The link to the
theme-head.phpfile that Josh provided is not the file from version 1.7. It is actually newer than the file included in version 1.7.1, and is meant to be included in version 1.7.2.
The reason for this is because we use a subversion repository (svn in short) primarily to allow for collaborative development, and also to keep track of changes to the theme’s files. (You can read more about the theme’s collaborative development at the theme’s [url=https://forum.graphene-theme.com/documentation/about-the-theme/]About[/url] page.)
In SVN, it is typical for developers to separate out major versions as branches of the main “trunk” of the source codes. So in the URL that Josh provided, the
/branches/1.7/bit means that you’re accessing the latest
theme-head.phpfile in the 1.7 branch, which contains the latest codes for all 1.7.* releases.
Not sure if you wanted to know all that, but there goes 🙂
Viewing 7 posts - 1 through 7 (of 7 total)
- You must be logged in to reply to this topic.