You’re a self-hosted WordPress blogger, and you’ve finally picked out a beautiful theme for your site — that’s a tough feat, one I certainly struggle with — and now it’s time to customize your site to fit your content and your personality. There are a variety of ways to go about doing that, but… how? Even for an experienced user, simple customizations that typically require multiple steps, including creating a plugin or child theme, can be tedious. But what if there is an easier alternative?
I want to introduce you to a two-part system so you’ll understand the power of what I have to share with you.
Hooks and Actions
Meet the hooks and actions system. WordPress has numerous hooks, or customization points, throughout its system, into which you can easily add your own actions, or customizations. Themes (and even plugins) can have their own hooks, and some themes certainly have many more than others.
Let’s look at a very basic example to see how these work. A common customization which you might want to make is to add your copyright statement to the footer of your site. In many themes, you can accomplish by adding your action (in this case, your copyright text) to the wp_footer
hook. The code would look like this:
function custom_add_copyright_statement() {
echo '<p>Copyright © 1603, William Shakespeare</p>';
}
add_action( 'wp_footer', 'custom_add_copyright_statement' );
Decently simple, right? But what if we could make that simpler? That’s where my free WordPress plugin, OpenHook, comes into play.
OpenHook, the Customization Manager for WordPress
What is OpenHook? In short, OpenHook is a WordPress plugin that streamlines the process of adding customizations to your WordPress site! But wait, there’s more!
Features
- Customize the hooks present in your favorite themes!
- NEW! Define any hook you want within OpenHook and add an action to it! In addition to the following themes which OpenHook supports explicitly, you can now use OpenHook to customize ANY hook (even something as arcane as
theme_hook_before_meta_987
) in ANY theme or plugin that has ANY hooks, from WordPress’ bare minimum hooks to hooks that are dynamically created and are as infinitely diverse as your site can be! - Hooks are explicitly enabled for the following themes, but you’re by no means limited to these alone!
- Flat (defunct?)
- Headway
- K2 (defunct? // actions created with the K2 Hook Up plugin can be imported)
- Thesis 1.8.x (defunct)
- Any theme that supports Theme Hook Alliance hooks
- NEW! Define any hook you want within OpenHook and add an action to it! In addition to the following themes which OpenHook supports explicitly, you can now use OpenHook to customize ANY hook (even something as arcane as
- OpenBox, a PHP-friendly “box” for use in customizing Thesis 2 (defunct)
- Quick access to the header and footer hooks of WordPress
- All hooks can be customized with text, HTML/CSS/JavaScript, PHP, or shortcodes
- All actions created with OpenHook can be selectively disabled
- A variety of actions already present in Flat, Thesis 1.8.x, and WordPress can be selectively disabled
- Hook visualization allows you to see exactly where each hook is fired on the front-end of your site
- Shortcodes
- , for masking email addresses from some spam robots
- [global], which makes use of custom fields on a draft page in order to provide a library of reusable strings
- , an admin-only shortcode for including PHP code within posts
- Ability to disable all shortcodes
- Display of
phpinfo()
in the admin panel - Options management, including tools to upgrade from OpenHook 2 and to uninstall (delete) all OpenHook options
- Only users with the
edit_themes
permission may access OpenHook or its features. If enabled by such a user, other users may useor
[global]
shortcodes in their entries as well.
Requirements
- An installation of WordPress 4.1 or newer, naturally
- The
exec
function must not be disabled by your host if you plan to use OpenHook to add PHP customizations
OpenHook may work with older versions, but given the ease with which both of those softwares can be updated, you really, really are encouraged to stay up-to-date!
Installation
OpenHook is available from the WordPress plugin repository, and so can be installed automatically from within your blog’s administration panel.
If you must do or just prefer the manual method, OpenHook is installed just like any other WordPress plugin.
Download
Visit the WordPress plugins repository to download the latest version!
Support
For support inquiries, please use the Contact panel within the OpenHook itself, the plugin repository support page, or the comments below!
Supporters
OpenHook development has been supported by the following generous individuals:
- JamieVaron.com
- The Girl’s Guide to Web Design
- Marketing Spiritual
- Bo Kauffmann
- Jen Healy
- Aaron Gravvat
- Sangas & Moss Pty Ltd
Donate to Further Development
If you would like to support OpenHook development, you may do so in one of two ways. The simplest way would be a monetary donation via PayPal:
Or you can buy me something directly from my wish list, thereby saving me the trouble!
OpenHook is released under the GPL and was both inspired and based upon K2 Hook Up.
Changelog
4.2.1
- [fixed]
load_plugin_textdomain()
changed to properly reference the/languages
directory (thanks pm1932) - [changed] Localization namespace is now
thesis-openhook
to conform to WordPress’ guideline that this namespace match OpenHook’s slug in the plugins repository (see https://make.wordpress.org/plugins/2015/09/01/plugin-translations-on-wordpress-org/) - [changed] Author links updated to reflect current domain and Twitter account
4.2.0
- [added] Ability to define custom hooks and to then add actions to them, effectively opening OpenHook support to all hooks across all WordPress themes!
- [added] New themes: K2
- [added] Ability to specify priorities on actions
- [added] Access to the WordPress hook
comment_form
- [added] Include Facebook “like” button in admin panel sidebar
- [fixed] Contact form link now works
- [fixed] Asterisks denoting that a hook has customizations added to it are now more accurate
- [fixed] OpenHook version and the Flat and Theme Hook Alliance hook options are now properly deleted when deleting OpenHook options
- [fixed]
OpenHook::upgrade()
‘s “is an upgraded needed?” checks now actually work, preventing upgrade code from processing on every page load - [fixed] More
WP_DEBUG
notices taken care of - [changed] OpenHook admin panels are more responsive on smaller screens
- [changed] Only one theme’s actions may be enabled at one time, saving processor power and preventing hook name conflicts
- [changed] Explicitly adhere to semantic versioning going forward
- [changed] OpenHook CSS is now minified
- [changed] File structure organized
- [changed] Simplified admin panel tabs to only highlight active action groups
4.1.0
- [added] Flat hooks
- [added] Theme Hook Alliance hooks
- [fixed] OpenBox is now compatible with Thesis 2.1.x
- [changed] Various text and links throughout OpenHook admin panel
- [changed] Optimized various bits of code, bringing it in line with WordPress coding standards
- [changed] Admin sidebar no longer appears on the server info page
4.0.1
- [fixed] Fixed broken class calls in options management functions
4.0.0
- [added] Now supporting Headway theme hooks!
- [added] Shortcodes manager introduced!
- [added] Users can now choose whether all hook panels are displayed or just one at a time
- [added] PHP shortcode — Arbitrary PHP code in your posts! (Admin users only.)
- [added] Email shortcode — Encodes email addresses for use in posts to thwart harvesters
- [added] Global shortcode — Take advantage of custom fields on a draft post to create a library of strings which may be used in any post
- [changed] Various code optimizations
3.4.0
- [added] OpenBox — a box added to Thesis 2’s box management, allowing for arbitrary code in Thesis 2’s skin editor
- [changed] OpenHook is now programmed as a class to allow its code to be self-contained. More code refinements will be coming
- [changed] Plugin is now named simply “OpenHook.” Viva la simplicity!
3.3.1
- [fixed]
thesis_hook_after_post_box
restored. Hat tip: Doug Foster
3.3.0
- [added] Hook visualization (Based upon http://headwaythemes.com/headway-hooks-visualized/)
- [changed] Improved handling of the options management functions (upgrade/delete options)
- [changed] When action groups are disabled, the hook pages now include a nag stating as much
- [fixed] Warnings about empty arrays when activating action groups
3.2.1
- [fixed] Bumped to make the repository update
3.2.0
- [added] Hooks with customizations are marked with asterisks in the dropdown select box
- [changed] Add link to
phpinfo()
under Tools menu - [changed] Verbiage for unhooking updated
- [fixed] Many undefined variable errors
- [fixed] Slashes are now properly stripped when upgrading from 2.x.x
- [fixed] Default Thesis 404 content can now be properly removed
3.1.0
- [fixed] Rare issue where the general settings panel doesn’t fully appear
3.0.0
- [changed] Total rewrite of the plugin
- [added]
phpinfo()
panel - [added] per-hook disabling of custom actions
- [added] option to process shortcodes on custom actions
- [added] ability to choose which actions to process (WordPress’s or Thesis’s or both’s)
- [added] ability to remove all OpenHook options
- [removed] several deprecated options
2.3.2
- [fixed] Remember the typos fixed in 2.3.1? There were others I should have caught then. I’m a terrible proofreader, but thanks, Dean, for catching them!
2.3.1
- [fixed] Fixed two stupid typos that killed everything that was right with the world. Well, they broke the plugin anyway. Thanks, Jim, for reporting so quickly!
2.3.0
- [added] Thesis 1.7’s four new hooks are now included.
- [removed] OpenHook’s file editing panels have been removed — Thesis has these by default now.
- [changed] Readme.txt updated.
2.2.5
- [fixed] Reverted change introduced in 2.2.3 regarding stripping of slashes
2.2.4
- [fixed] Fixed a syntax error, reported by multiple users.
2.2.3
- [fixed] Fixed a bug which prevented the After Teasers Box hook from saving properly. Thanks, Michael Curving.
- [fixed] Fixed an issue where the file editors would strip slashes unnecessarily. Thanks, Kristarella.
2.2.2
- Adding content to the
wp_footer
hook block actually works now. Thanks, Illustrata
2.2.1
- Very minor bug fix: Removed option to remove
thesis_admin_link()
so that it can be used elsewhere; this function is no longer added via a hook in Thesis 1.5, so the OpenHook option essentially did nothing. There’s nothing to gain by upgrading other than a slightly cleaner “Footer” section on the main OpenHook page.
2.2.0
- New hooks:
wp_head
,thesis_hook_comment_field
, andwp_footer
! - Separation of stylesheet editing to its own page.
- Addition of custom functions file editing, also on its own page.
- Major internationalization improvements
- Jump box added to quickly navigate to any of the dozens of hooks
- Option to include an invisible, nofollowed Project Honey Pot link in the footer area to help in the war against spammers.
- …and probably more that I can’t even remember!
2.1.0
- Added two new hooks:
thesis_hook_before_content_area
andthesis_hook_after_content_area
.
2.0.2
- Added ability to customize the save button text.
- Added a bit more explanatory text on the OpenHook panel in the top area.
- Fixed a bug with the “404 Title” hook that prevented slashes from being stripped properly. Thanks, Justin Thomas.
2.0.1
- Fixed a bug with the “After Header” checkbox for PHP usage thanks to Alec Wild
2.0.0
- Reorganization of just about all of the under-the-hood code.
- More robust stylesheet editing — should work for more people now.
- Complete stylistic redesign to match other WordPress admin panels.
- Save buttons added liberally throughout the page.
- Added support for the latest Thesis hooks.
1.1.0
- Debug info bugfix thanks to firstdayblack
- Simple
custom/custom.css
editing from within the OpenHook panel
1.0.0
- Renamed from 0.2 to mark inclusion in the WordPress plugin directory!
0.2.0
- Some code reorganization
- Added options to easily remove Thesis’s default actions
- Add some explanatory text to some hooks
0.1.0
- Initial release
Rick, thank you so much for this! I can’t wait to try it out!
Hope you enjoy it!
And everyone… Keep me posted on bugs!
Wow this is sweet Rick. Great idea! I wish I would have seen this before I spent all that time learning hooks last week…
Seriously, this will save a lot of people a lot of time.
‑Don
Learning hooks and using the
custom/custom_functions.php
file is definitely the ideal; it ensures that your customizations aren’t dependent upon a plugin staying up-to-date in order to work with the latest version of Thesis. However, I will be doing my best to keep this thing current with what’s going on in the “Thesisphere.”Thanks Rick… this is great. Would you also mind sharing the functions and CSS for your thesis promo ‘supercharge your blog’ box at the end of each post?
Thanks,
Dave
I have several tutorials in mind to explain how I’m doing various things ’round here. All in good time. :D
I downloaded, then followed the directions, but it’s still not showing up in my plugin panel — what am I doing wrong? I’m sure I put it in the right spot, because it’s in the same folder as the other things I DO see in the plugin panel.
Thanks,
Kelly (blog under construction: http://www.kellythekitchencop.org)
Never mind, I’m good now. Can’t wait to play with this, thank you!
Glad you got it working! :)
It looks like you have the directory in your plugins folder, but when I try to load any of the files within the folder (such as
thesis-openhook.php
), a page not found error is shown. Make sure that all of the files within thethesis-openhook/
directory are uploaded.Rick,
This is a great plugin and while I kind of enjoy creating custom hooks this will also save me a ton of time. Thanks for creating it.
Nice job Rick!
It’s looking very good Rick. Thank you very much.
You’re very welcome!
Rick
Nice work! I look forward to playing with this plugin.
I hope you enjoy it!
Rick,
I’ll probably link to this from my site, even though I will likely just stick with custom_functions.php myself. One question: does it support php coding, like conditionals, or is it strictly for text?
Really, really good idea and good work. You are a fantastic help to the Thesis community (and the WordPress community in general).
It works with PHP just fine. Check out the second example in the post itself. :)
Basically, anything that can be done with
custom_functions.php
can be replicated easily enough through OpenHook’s panel!Ak! Thanks Rick. Obviously, I skimmed too quickly. Victim of the attention deficit culture.
Great job.
Thanks, man, and thanks for the plug on your site!
Gotta love the GPL. Glad my K2 Hook Up plugin inspired this plugin for Thesis.
I’m very grateful for your plugin, Eric! Seems like whenever I try to do admin panel stuff, it’s so complex, leading to surrender on my part. Your plugin was very well written — elegant in its simplicity, as they say — and helped me learn some stuff!
Thank you! I was thinking of using Thesis on one of my sites but I really don’t have time to learn hooks right now.
What a wonderful gift for the community!
Anything I can do to help you get rolling with Thesis, I’d be happy to do. I definitely believe in the power of Thesis to greatly enhance a site’s appeal — both to users and to search engines.
Thesis OpenHook was just upgraded to version 0.2 with some very handy new options in the admin panel. Go on, download it! :D
WOW, how awesome is that! Thesis OpenHook downloaded and installed with absolutely no problems. Can’t wait to start inserting things! Thanks Rick for all your hard work!
You’re welcome. Enjoy!
Rick, Great plugin for us novices. My question: If I use this, will it overwrite any hooks already inserted in the custom functions file? Thanks!
No, OpenHook will not override the
custom/custom_functions.php
file. Both Thesis’ built-in customization folder and OpenHook will load when using Thesis, so the two are complementary.It may be easier for some to keep larger blocks of code in their
custom/custom_functions.php
file — which they can load up in a text editor with syntax highlighting and line numbers, for example — while using OpenHook to easily remove Thesis’ default actions and to add in smaller customizations.The whole point is to empower the community to be able to customize with increased ease, and I hope I’ve done that.
Rick, it doesnt look like the inserted text using the hooks “obeys” the style built into Thesis… correct? For instance I tried to move my byline from the sidebar to area before context and used HTML to style it, ie, H3 tags, but it didn’t comply. How do we do simple stuff like adjust color, size of font, etc, within the hooks?
It does obey the style, but in order to take advantage of that, you need to replicate as closely as possible Thesis’ markup structure.
For instance, to do what you’re doing, you might try something like this in the “Before Content” box:
The first and last lines are the most important as they are necessary to catch Thesis’ styling for formatted text, such as the text found in posts and comments.
Hope this gets you headed in the right direction. :)
Rick, that worked perfectly; now I just have to tweak it.
I should have known I needed more code than that, because I had to use the div ‘s etc, in my sidebar section when I altered it with hooks!! I guess I was just too excited to be able to tweak my blog right in the admin panel that I got ahead of myself!
This application is cool and by the date I can tell that it is hot off the press. Thank you for this.
Hey Rick,
Thanks for this useful plugin :) But now comes the dilemma that started with using Thesis — to plugin or not to plugin, that is the question …
Great stuff anyways :)
Thank you so much for this, LOVE IT!!
Hey Rick,
No matter what I plug in I get the following warning:
Warning: fopen [function.fopen]: failed to open stream: Permission denied in wp-content/plugins/options.php on line 32 Error editing.
How do I fix that?
From the looks of the error message, I assume that you only uploaded the files within the
thesis-openhook/
folder, rather than the entire folder itself, with the files therein.In other words, the
options.php
file shouldn’t be located atwp-content/plugins/options.php
; on the contrary, it (and the other OpenHook files) should be atwp-content/plugins/thesis-openhook/options.php
.Hope this helps you get it workin’!
DOOOOD!!
RAAAAAWWWKZ!
dude. u rock. I (we) really (really, really, really, really) appreciate not only this tool, but also ALL the knowledge & expertise you bring to the Thesis forums.
— j
Rick
Impressive, excellent work! I’m looking forward to testing it out! Thanks!
-Miguel
Rick, I had the same problem as Jason. Your zip file was the problem. It needs a folder inside with the actual files.
FTP replaces the original dates with the transfer time and date so in order to preserve the original file dates and times, I always unzip WordPress, Themes and Plugins remotely using CPanel File Manager or equivalent.
Rick: I rebuilt the ZIP file — making sure I selected to compress the
thesis-openhook/
folder itself rather than just the files. Should be fine now. I’m sure I messed something up a few days ago when I was preparing for uploading to the plugins directory — which still hasn’t worked properly for me. Hopefully all is well now.Santa came early this year. Thanks so much, Rick!
Nice little PlugIn which makes the work of a lot of people much easier. But maybe there is a little bug? When I check the box “Add debug information” the number of queries and seconds appear in the footer. But when I uncheck the box, the queries vanish, the seconds stay. Bug or feature?
If that’s what is happening, that’s a bug. I’ll make sure it’s working correctly for the next release. Thanks. :D
Rick, thanks for caring. But there ist another major bug in your plugin. The text on the save button says “update options” or something like that. It should of course be “BIG ASS SAVE BUTTON”! ;-)
Haha. Chris and I have different ideas on what makes a good submit button. :P
That said, here’s the fix for the debug stats bug. This block of code is near the bottom of
thesis-openhook/thesis-openhook.php
:Change it to this:
Will definitely be in the next version of OpenHook — along with the beginnings of being able to edit
custom/custom.css
directly from the admin panel! :DYour bugfix works perfectly. Thank you very much. :-)
firstdayblack: Glad to hear it! Let me know if anything else comes up.
I’m having the same problem as Jason. All my files are under “thesis-openhook” folder but I get the same message. I hate hooks, why complicating / “fixing” things when there’s no need …
Also when I try to add it manually via custom_functions.php I get this message when i try to access my site “Parse error: syntax error, unexpected ‘<’ in wp-content/themes/thesis/custom/custom_functions.php on line 37”
I add it like this:
/* YOAST BreadCrumb */
function yoast_breadcrumb () {
}
add_action(’thesis_hook_before_title, ‘yoast_breadcrumb’);
hate .. it …
I mean like this ..sorry
/* YOAST BreadCrumb */
function yoast_breadcrumb () {
}
add_action(’thesis_hook_before_title, ‘yoast_breadcrumb’);
Sorry feel free to delete my latest 2 comments but somehow php code is not showing …
Yeah, unless the code is properly escaped, WordPress eats it.
However, you are welcome to e‑mail me the code, and I’ll help you get it working.
Regarding Thesis OpenHook, on which site are you attempting to install it? I’d like to take a look, if possible.
Hey Rick, thanks for the support! New code is not showing me error message anymore but I can’t see the breadcrumbs .… but that’s another discussion for forums not here
This is most helpful — thank you!
I get this message when I try to update a hook.
Warning: fopen(/home/p5r54565/public_html//wp-content/themes/thesis/custom/custom.css) [function.fopen]: failed to open stream: Permission denied in /home/p5r54565/public_html/wp-content/plugins/thesis-openhook/options.php on line 32
Error editing.
Is this a problem with permissions on my host server?
Oh goodness… I think I may have accidentally uploaded my development code. (Lesson? Organization is GOOD and should NOT be neglected!) When I get off of my day job here in a few hours, I’ll be able to devote some time to getting this thing working, as well as getting a canonical release uploaded to WordPress Extend.
Everyone else: Glad you’re enjoying the plugin. Hopefully I can make it even nicer and more foolproof. I really want to get a more elegant admin panel going, with easier to read/find panels.
This looks really excellent, Rick, thanks for creating it. Anything that makes Thesis easier to use! I’ve installed it on my WP 2.6.5 blog, now just reading up on hooks to understand better what I’d like to do ;)
Thanks again.
That’s awesome Rick, thanks for devising this! Having all the hooks at the same place, and being able to edit them so simply will make the customizing job that much easier.
You even added many useful and cool comments when appropriate !
OpenHook’s been updated to 1.1 — bug fix + style sheet editing! Should show up in your plugins panel for auto-upgrading; this baby’s hosted at WordPress now. :D
Slick. Very nice to have a “front-end” to the Thesis “back-end” ;) Thank you!
Rick:
Can you tell me how to add an iFrame to my blog. Can I use hooks?
Actually I need about 5 pages with 5 different iFrames. I would appreciate the help.
Rick, you did it! I love that new save button :-D :-D
Hey Rick,
This is a fabulous idea! I didn’t discover it until today. Sadly though, the download link doesn’t seem to be working. :(
The download link points to the WordPress plugin directory page, which is where you’ll need to download the file from. (Right-clicking on the download link on this page — or using a download manager to grab the link — will not work; it’s currently a redirection, not a download.)
Yeah I know buddy. I went over to the WordPress directory, and clicked on the big ‘Download’ button and it’s coming up as a dead link for me.
Yup — I get a 404 too.
Well, that’s unfortunate. I updated the download links in the post above to point to a hosted version here. Sorry ’bout that, folks!
This plug-in fails to install in WordPress 2.7 final.
@Tom K.: installed perfectly on my copy of WP 2.7 RC2 -
@Rick — in RC2 — plugin option shows up as its own tab under appearance as Thesis Openhook — so even easier to find than advertised.
Installed perfectly. Now I have to learn what to do with it.
Jon
Edit by Rick Beckman: Fixed a bit of markup.
Thanks Jon. I re-tried the install and it worked.
Tom K.: What method of installing were you using? I’ve yet to have any luck with the automated plugin installer. Glad you got it installed, whatever method you used!
Jonathan Soroko: OpenHook’s always had its own tab — below “Design” on WordPress < 2.7 — but WordPress 2.7 definitely makes the subheadings more accessible. Have fun learning how to use it, and definitely feel free to experiment — especially when fixing errors is as simple as deleting from a text box and re-saving the form.
Hi! I’m totally new to hooks and am trying out this plugin. I added text to the Before Sidebars hook to have the words “Click current post title to see related movie below. ” appear on my site. This is because the movie is related to the post via a custom field, but if you just go to the home page (not the post link itself), the movie does not appear. I would like this message to appear only on the home page, and I would like its style to match the other widget headings. Can anyone help? Sorry to be so limited!
Try using something like this in the “Before Sidebars” box, making sure to check the “Use PHP” option:
Yeah, it’s a lot of code, but it will ensure that the headline is rendered identically to other sidebar headings — and that it will respond to font changes made within the Design Options panels.
Using this markup will place a lot of margin on the bottom of the heading, and you can lessen it by using this line in your
custom/custom.css
file:Thanks, installed without a hitch. I can’t wait to use this… Faboulous!
Glad to hear it; enjoy!
Hi Rick.
I have a sandbox build that I am playing around with. I checked off the footer:
“Remove Thesis attribution — Only those who purchased Thesis using the Developer’s Option are allowed to remove the Thesis attribution link. If you purchased the Personal Option and remove the Thesis attribution, be sure to include it within your own footer content (perhaps replacing it with an
affiliate link to DIYthemes).”
Yes, I do have a developers license, just to let you know.
The attribution is still showing up.
I also added in some text in the input box for the footer.
Copyright 2008, BOTC
That shows up just fine.
Here is the site.
Sorry to say I could not understand what this meant:
You’re welcome to ask support below in the comments; prior to posting any code, though, please make sure it is properly escaped. Thanks!
(and going to the link did not give me any clues either)
Any ideas as to what can be wrong.
I am glad you have made this plugin. Thanks for all your efforts.
So I’m curious how this plays with Thesis in a WPMU setting. Does it involve any file alterations, outside of custom.css?
Just wondering how it would work. One of the things that drew me to Thesis in the first place was how well it played with WPMU. Being able to tweak layout elements trivially across a series of blogs without hacking at the theme files themselves.
I’m not familiar with WordPress μ’s architecture, so I would love to hear whether or not OpenHook works or not. You’re right in assuming that the only actual file editing which goes on is of the custom style sheet; however, that option is only available if a user has top-tier administrator privileges, which may not be the case in a multi-user environment.
With regards to WMPU compatibility, I tested it and it works just fine. Settings are isolated to the individual blog those changes were done on. I haven’t checked the custom.css stuff, but if you simply don’t allow it, it’s not a problem. Were it allowed, I’m sure it would propagate across all blogs sharing the same theme directory.
Golly but this is good. I had put off upgrading Thesis until after I had WP 2.7 up and running, then did Thesis and this plugin and I am very impressed and very, very thankful for all the hard work you have contributed in general, and on this plugin in particular. Really. Kudos to you.
Hi Rick,
I LOVE this- it is wonderful and made using Thesis so much easier. I’m wondering how to put my Feedburner stats into the nav bar, where the subscribe button was… is it possible to do it using openhook?
Not as easily as you’d like; it would involve removing the default nav bar and then writing your own nav bar in the “Before Header” area. Otherwise, you could perhaps remove the feed link (via Thesis Options) and then insert your own Feedburn stats via the “Before Header” option of OpenHook. This will place your code after the nav menu and before the header, so you would need to position it into the appropriate place using
custom/custom.css
.@Rick, Thanks! So what’s the code for the .custom CSS if I want the stats aligned to the right? And maybe this is something that you could consider adding to the next version? (Says the non technical person with a smile on her face?)
Is there an option to place a code snippet in between the by-line and beginning of the post’s text?
Try the “Before Post” field. It should do what you’re wanting.
Oops! I thought I had tried that prior to posting this comment. Sorry, it worked like a charm :o)
I wanted to add the Add to Any javascript “After Content” so I got the code and pasted it — but it doesn’t appear after the post content.
I’ve changed permissions on the custom/custom.css to 777 -
Did I miss something?
Thanks Rick for a killer tool — and I LOVE the “little ass save button”
Rick Butts
Edit by Rick Beckman: Fixed link markup.
Well, that tells me what I need to do next in OpenHook — more documentation! “After Content” refers to nearly the bottom of the page — after posts and comments have all been output. If you want to add something to the end of each post before the comments start, use “After Post” instead. :)
well DOH!
I’m obviously a retard — I shot down the page until I found after content and then figured I was where I needed to be.
I’ll TRY to pay more attention now — hopefully my .js will work there.
Thanks Rick -
Rick Butts
I’m trying to use this plugin for the first time — I can add the following code to custom_functions and it works fine, but when I add the exact same thing inside the plugin, it doesn’t work. What am I missing to use the plugin?
function add_social_profiles () {
global $comment;
?>
user_id); ?>
<?php
}
add_action('thesis_hook_after_comment_meta', 'add_social_profiles');
Looks like WordPress garbled the code a bit (tip: always run code through an escaping tool prior to posting in comments or posts), so I’m not sure of the exact code to give you… However, when using OpenHook, rather than using this:
…you can call your function directly, like this:
Let me know if you get it working.
Rick,
I use the All-in-One SEO plugin and when modifying the header, it seems I get a conflict with that plugin.
Here’s my error message -
Warning: Cannot modify header information — headers already sent by (output started at /home/rob888/public_html/shop/wp-content/plugins/all-in-one-seo-pack/all_in_one_seo_pack.php:632) in /home/rob888/public_html/shop/wp-content/plugins/thesis-openhook/thesis-openhook.php(191) : eval()‘d code on line 1
What do I do?
Thanks!
What code are you using in OpenHook? It’s possible that header information is being output, which of course would conflict with All-in-One SEO which has already output header information.
Amazing. Thanks Rick!
-Dave
This is an awesome plug-in! Thank you for taking the time to put it together.
I’m new to Thesis and using this plugin and I have a follow-up question from the forums that I’d like to ask. I’m trying to add a email and twitter link next to my RSS button in the nav bar. I’d like for it to look like @mnichols site Anxiety, Panic & Health but I’m just not sure what to paste into the “Before Header” block. I want to keep my nav menu but add the email and twitter link to the right.
I tried using the code you suggested here: RSS email next to Subscribe by RSS in nav bar but it’s not exactly what I’m after.
Sorry for the drawn out comment and any insight you have to offer is greatly appreciated.
I have added the code below (via http://www.sugarrae.com) in the header box to change to test adding an image in the header area, but it didn’t work, but when I added directly through custom_functions.php file it worked. Anybody know what the problem is… I’m using version 2.7 of wordpress. Thanks!
/* Custom Header Image */
function add_header_image () {
echo “<a>
</a>”;
}
add_action(‘thesis_hook_after_title’, ‘add_header_image’);
New to Thesis and OpenHook
Working in a sandbox environment. My question has to do with migration to a production environment.
It looks like your plugin doesn’t modify the custom functuions php file. Does it store the modifications in the database? I suppose I could have looked. Moving a file into production is easy. Exporting a table, or table contents is a little harder. Suggestions on how to migrate hooks from a sandbox to a production environment?
Last time I did it, I copy/pasted the values from the test site to the live site manually. Exporting would be a matter of finding the relevant rows in the
wp_options
table, then importing them into the production site prior to installing OpenHook (which will create new options of the same name, resulting in duplicate entries, which I’m unsure how they’d be handled in WordPress).Wow — Thanks for the fast reply! Thats sort of what I figured. Maybe an export/import function in the next release? Your file format is already defined as custom_functions.php. I think for my sandbox I am going to just work in the php file. It will help me hone my php skills and make migration to production a snap! Oh, crud, did I hard code some absolute sandbox URLs? Ug. Hmm, relative URLS are bad in downstream feeds, Ug.
OK — I’ll work it out.
Thanks again
An import/export might not be a bad idea. I could see it being useful even for bloggers who deploy multiple blogs, all with Thesis & similar “base” customizations.
I’ll have to get with Chris about this; we’re wanting OpenHook functionality built in to Thesis in the future, so I’d rather move in that direction, and we could maybe add import/export for Thesis settings as a whole. Now that’d be total awesomeness.
Great plugin that is really usable and useful for noobs like us. Thanks and keep up the good work!
Getting the following error above the header on home page, and at the top and bottom of the wordpress dashboard?????
Warning: include_once(/home/admin/public_html/wp-content/plugins/__MACOSX/) [function.include-once]: failed to open stream: Success in /home/admin/public_html/wp-settings.php on line 465
Warning: include_once() [function.include]: Failed opening ‘/home/admin/public_html/wp-content/plugins/__MACOSX/’ for inclusion (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/admin/public_html/wp-settings.php on line 465
Just to add, I have deactivated the theme and deleted it as well and I still have this issue.
Thanks Rick
Now, I can’t login to admin…This is the new error:
Warning: include_once(/home/admin/public_html/wp-content/plugins/__MACOSX/) [function.include-once]: failed to open stream: Success in /home/admin/public_html/wp-settings.php on line 465
Warning: include_once() [function.include]: Failed opening ‘/home/admin/public_html/wp-content/plugins/__MACOSX/’ for inclusion (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/admin/public_html/wp-settings.php on line 465
Warning: Cannot modify header information — headers already sent by (output started at /home/admin/public_html/wp-settings.php:465) in /home/admin/public_html/wp-includes/pluggable.php on line 850
Viewing your Web server in FTP, do you see a
__MACOSX
folder in theplugins
folder? I’m not sure what would have created it, but for some reason, your WordPress installation thinks its there or something. Quite frankly, I’ve never come across something like this before. Verify the files on your server, and delete the folder if it’s there. If it’s not, ask you host if they can track it down for you (it may be hidden).Rick,
I am using a single column design and I want the multimedia box to be in the content area. I can’t figure out how to do this?
Is it possible to run text in a column alongside it?
Thanks in advance.
@Rick Beckman Two points:
RE: __MACOSX folder
When you install the plugin from the WP Admin page (browse for a zip file), the _MACOSX file shows up as part of the plugin resulting in the error noted above. I duplicated it and couldn’t figure out what was going on until I looked at the structure of the .zip file.
If you download the plugin using your download link, the same file is there. You have to unzip the file, then muck around in the folder structure until you find the actual plugin file. So that’s the culprit.
Second:
Question: My CSS file changes, working fine in custom.css, do not work at all with the same custom.css copy and pasted into the plugin in the css area. The custom.css file is in the Thesis Custom folder as needed, but when I execute it, I get the plain vanilla Thesis theme instead of the fabulous customizations I have done ;>))
My themes are in default location, but I have many blogs and they are located in a subdirectory of \public_html and then the installed WP blog with the Thesis theme. Is there any path issues to the CSS values? \public_html\blog\themes\thesis\custom versus \public_html\themes\thesis\custom?
Thanks Rick,
I would like to second Dave’s comment above re: your “Super charge your blog” box that appears at the end of every post promoting the thesis theme. Providing a custom_functions code for something like this would be super cool.
I’m working on switching my site over to Thesis, and OpenHook has proven invaluable so far. I have only one suggestion, and if it’s been made before, just consider this another vote :)
It would *rock* if you could duplicate the ‘little ass save button’ at the top of the page and periodically throughout the page. The vast majority of stuff I’m doing at the moment involves the custom css file, and having to scroll alllll the way down each time to press the save button is a little cumbersome.
Other than that minor annoyance, OpenHook is fantastic — keep up the great work!
Hello Rick, thanks for a wonderful plugin.
I am trying to use Openhook in order to insert a slideshow-application before my sidebars. Eventhough I have added the following piece of code in the correct field of Openhook, with ‘Execute PHP’ enabled,
” ”
I get the following error message where my slideshow otherwise would be:
” Warning: include(/public_html/wp-content/themes/thesis/gallery.php) [function.include]: failed to open stream: No such file or directory in /home/polysj4/public_html/wp-content/plugins/thesis-openhook/thesis-openhook.php(367) : eval()‘d code on line 1 ”
Is there a problem with the include-command, or have I missed something very obvious? Any help would be most appreciated, and thanks again for a truly helpful tool.
ADDITION to previous comment:
the line of code that I have inserted into Openhook is:
“”
?php include(‘/public_html/wp-content/themes/thesis/gallery.php’); ?
though wrapped within the appropriate — signs.
I apologise for all the extra clutter
Hi Rick,
Great plugin, thanks.
I have the multimedia box disabled until I can get it set up the way I want, with a miniblog, using one category of posts from the main blog.There’s a widget plugin for this, and I want to put the widget in the multimedia box. Is this possible? If not, can I put one category of posts there, using OpenHook?
I think there’s a small bug with your plugin. When I use the custom functions.php file and add something before the header, it appears between the nav bar and the top of the header. When I use your plugin and add it in the “before header” box it appears above the nav bar. Any suggestions?
The reason is that OpenHook’s code is fired prior to Thesis’ (plugins precede themes in the WordPress hierarchy), so it isn’t really a bug so much as a necessity. If you want something below the nav menu, remove the default nav menu with the checkbox in OpenHook, then add
<?php thesis_nav_menu(); ?>
*before* your code in the Before Header box, being sure that the “Use PHP” box for that area is checked.THANK YOU very much for OpenHook. It’s so handy just to pop in and change bits.
Wow… I spent 3 or so hours earlier getting error messages thrown up while trying to create my own hook. I then used this plugin and it worked with in 2 minutes. LOL.
Nice work!
I’ve uploaded thesis openhook to my plugins, but when I go to activate it, the plugin doesn’t show up at all. I’ve tried installing and uninstalling twice.. Please advise as how to get it to work. Thannks,
Mark
OpenHook is truly amazing, *almost* as important a contribution as Thesis itself. :=)
Hey gang,
I would like to add a bit of text with a link to another site as follows:
Read Kelley Bell’s Columns on The Huffington Post: http://www.huffingtonpost.com/kelley-bellwenzlaff/#blogger_bio
How do I format this so that the link is hot, and you just see “The Huffington Post” instead of the whole web address?
Also, when using openhook to place this, I am open to suggestions regarding the best placement on the site.
I tried it under the header, but the text was so small and off to the left, it looked kind of bad. Any ideas?
Boy this sure helps. Nice. Thanks.
I am a real novice here. But I have installed thesis in WP because I like the idea of having drop down combo boxes for Categories. I cant seem to make this happen. For example:
Software (category)
Adobe Plugins (sub category)
NIK Vivesa (sub category)
Hardware (Category)
Printers (sub)
Scanners (sub)
and so on. Then when choosing the Software category, the drop down would list Adobe and NIK. Using the Hardware drop down, choose Printers or Scanners. etc.
Can this be done? and how?
Gary
OK, I’ve downloaded and installed it on my BS blog and it all went well, but I still have no idea how to work with hooks. Where would I be able to find a good site that explains working with hooks in such a way that even an idiot could follow it.
Hey Rick,
Is there a difference in how open hook acts when WP is installed in the main folder or a sub folder?
In a site with WP installed in a sub folder, the boxes for open hook are all different and don’t have the stretch function. Also the custom.css box at the top is missing from the site where WP is installed in a sub folder.
Is there some sort of path issue when the plug in is used on sites where WP is installed in a sub folder?
This is a great plug in. Having the ability to alter a site with these admin files is a huge time saver.
Thanks,
John
hey… you already rock with this one but are you preparing something special for us in connection to Thesis 1.4 ?
Well hello there. What is this fine post doing at the top of the page? Do I smell 1.4 featured posts in action!?
Hi, I just wanted to thank you for the excellent plugin. I am also recently a huge fan of thesis (as you can see on my blog) and your plugin is going to save me a whole lot of time.
All the best in the new year.
Hi Rick -
Do you plan on adding the new “thesis_hook_feature_box” option to your Open-Hooks plugin?
Thanks!
wondering the same thing as Rick. how do you add the feature box using OpenHook?
Hello,
The styling that I added to .custom #container on the custom css file no longer renders after I installed this plug-in. The body.custom is fine though. Do you know why the custom class would stop working??
Sorry… never mind, the issue was caused because I turned on the “full-width” option. The plug-in works great, thanks!
Hello,
I like this stuff, it would be nice if there are different coulours on particular parts of code (something like in code editors)-or do you have some tips on good plugin for that? Other thing, are you going to implement “Featrured box” ? Thank you anyway ;)
Hello Rick, I just spent quite many hours learning about Thesis and I have just installed your openhooks plugin. Thank you for making things easier for me as I am pretty much a beginner.
Can I find out if feature boxes are the boxes that are below your multimedia box? What would be the codes for these? I am interested to have the same layout as the one on this website.
The feature box in Thesis 1.4 appears at the top of your site in a definable place in the Design Options. The boxes you refer to (which I’m no longer using, actually) were created using the process described here (sorry about the broken images; such is the result of having imported content from all of my blogs into one location).
It’s been a while since I’ve checked comments in this thread — been so busy working with Thesis itself, I’ve neglected this bad boy.
Here are my plans for the next version of OpenHook, and no, I don’t have any clue about a release date — I’m still hoping Chris will just let me integrate the thing completely into Thesis!
Support for Thesis 1.4’s new hooks.
More attractive layout of the editing boxes.
More rugged security.
Support for Thesis installations in directories other than
thesis/
forcustom.css
editing.And so on.
Hi Rick -
I want to use frontpage slide show on only my front page. I put the php code in open hook “after header” and it works great. Problem is, it conflicts with a plugin used on another page.
How can I make this code work on only the front page?
Even better, How can I exclude this code on a specific page using open hook?
Thanks — Love your work!
You can wrap your code with any one of WordPress’ conditional tags.
For example, to include stuff only on the front page of your blog:
Or to exclude content from a certain page, you will need the ID number of the page you want to exclude from. Then, use the same setup as the “on front page only” code above, but use the
!
operand to negate the conditional, like this:The
#
should be replaced with the number of the page in question.In both instances, you would need to check OpenHook’s “Use PHP” box for whichever hook you’re using dynamic code within.
Wow — That was simple. I just learned a new PHP lesson — Thanks, Rick!
You’re very welcome!
Is there anyway to make after_post hook really after the post and before any third-party plugins using OpenHook? I’ll dig through the above comments to see if someone else has asked. Thanks!! :)
Is this compatible with WordPress 2.7? Notes say Compatible up to: 2.6.3. I am excited to use this as it sounds like it will help me tremendously in my new work with Thesis.
Yeah, it works with 2.7 for the most part. :)
I’m hoping to improve compatibility in the future, when I have some time to work on it. Tons to do!
when you are talking about the new version and things to do :) , I will really appreciate if the “SAVE” button has the fixed position so I dont have to sroll to the bottom of the page everytime I change something…
Ooh, a fixed save button. Hadn’t thought about that one. That’s definitely preferable to a bunch of save buttons strewn about after each box (unless I figure out how to use Ajax to save just one box at a time w/o refreshing the page). Since JavaScript makes about as much sense to me as Esperanto, I think I’ll be sticking with a fixed save button for the foreseeable future. Thanks for the suggestion, Maniac!
I’m creating my own affiliate ad in HTML and using OpenHook to insert it on my blog via the “After Comments” box. My ad includes a gif image and no matter what I do, I can’t get it to show up. Are images inserted through OpenHook supposed to be in a particular location on my host server? What is the correct pathname to use?
Thanks.
Cynthia, it entirely depends upon where you’ve uploaded the image on your server. If you’re placing the image in your
thesis/custom/images
directory, then that is the directory for the image you’ll need to reference in your image code.Rick,
I put the image in that directory and tried using full and partial path names and it still would not show up.
I also was trying to make the image clickable with an affiliate link.
The image showed up and was clickable when I made the ad in Dreamweaver, but when I copied and pasted the text into OpenHook, I had to change the path names (from the one on my hard drive to the path to the file on the server) and just couldn’t come up with the right sequence of HTML to get the image to show in my table. Any ideas?
Thanks!
Cynthia
Rick,
Here’s a follow-up to my previous question. I used your DIV tip above to get the text in my HTML ad (which I put in a table) to be styled like the rest of the Thesis text. I love the font and leading, but now the style supercedes the cellpadding I enter in my HTML. Also, there’s too much space above my headline and subhead. Does this mean I have to modify the CSS file? Which one? How?
Thanks! (I really love working with Thesis and OpenHook!)
Cynthia
Hi Rick,
This is a fantastic plugin, thank you. However I’m having a problem getting the default Thesis comments link to remove. I am running the following code in the after post hook:
<a href="">Permalink -
-
<a href="">Comments ()
The code works but checking the “remove Thesis comments link” does nothing. I can’t remove it using the custom css file either. Any idea what’s going on?
Er, that’s not the code. It’s running PHP too.
Jacob, are you using Thesis 1.4.2? There was a weird issue with 1.4 which prevented the
remove_action()
for the comments link from working, but it has since been fixed.Just upgraded and problem solved. Thanks again for a great plugin!
Has anybody had any luck with getting thesis-openhook to work as a plugin under MU?
Hi rick,
I’m using thesis 1.4.2 and I having problems with the custom.css, just cant see the text box.
Are you havng this problem to?
Thanks.
If no text box for the custom.css is showing up, that’s because OpenHook couldn’t access the
custom.css
file. The box is hidden in such a case to prevent larger problems.File permissions, file structure, unusual server setups… Lots of things could prevent the file from being accessed.
Most common, though, is that Thesis is installed somewhere other than in
wp-content/themes/thesis/
(if the folder isn’tthesis/
, OpenHook doesn’t touch thecustom.css
file).Oh! I guess this is the problem I have the theme on
thesis142/
.Thanks!
My problem is maybe one of those ‘lots of things’ other than the file structure. It’s located here: http://www.lawnamackie.ca/wordpress/wp-content/themes/thesis/custom/custom.css
Can you help?
OK, basic question —
I uploaded my logo, and used OpenHook before_title hook with this:
<img align="left" src="http://twilightearth.com/public_html/wp-content/themes/thesis1.3.3/custom/images/twilightearth_70.jpg" style=""/>
and I see the above when I view the source code, but no image shows up.
What am I doing wrong?
http://twilightearth.com
Help!
Using OpenHook to put logo into header: I uploaded the image, and I see the line in the ‘view source’ option, but the logo doesn’t show up. When I type the URL of the image in the address bar, I get a 404 page.
Here’s the site: http://twilightearth.com
Looks like you got it sorted out? Looks good.
Hey Rick,
Question for you. Just reinstalled thesis for a new blog I am developing, and added openhook to it.
For some reason in open hook I do not see the custom.css: box. At the top of the screen is “Before HTML:”.
Any ideas as to why the Custom CSS box would not be showing up in Open Hook?
Thanks in advance!
Doc
Check out this comment just a few above yours. :)
Hi Rick, thanks for the quick answer.
My atyle.css is located in wp-content/themes/thesis
What should the file permission be for openhook to see it?
Thanks, Doc
I assume it should be set to be server writable, but I’m not pretending to know that much about server configurations. Try
0777
as the permissions on it to see if that resolves it.solved my problem — thanks
Just wanted to say thank you for this plugin. It’s very helpful.
LOVE this plugin! Thanks for your time and effort in creating it. Saves a great deal of time for us newbies in customizing the Thesis them.
You’re welcome! I’m glad it’s been of use to you.
Just passing by to say thank you for the good plugin! I can do with it almost everything needed. And, very important — to edit the custom.css without even starting an FTP program and all that downloading, editing, uploading etc. :)
Please, continue supporting it, this obviously becomes my main tool :)
Thanks again!
Hey!
Thanks for the AWESOME plugin. I was wondering if there was a good way to use Openhook to do this:
Thesis is set on my blog to have one sidebar, but on certain Pages, I would like it to be the two sidebar style. Is there anyway to do an If/Else statement in Openhook to help facilitate this happening?
Thank you so much!
Brad
Unfortunately, not that I’m aware of. More advanced control over the sidebars like that more than likely would involve hacking Thesis’ core to add in your conditionals, which I don’t recommend. However, with some CSS trickery, you could probably achieve what you’re wanting. Have you asked about this in the Thesis Customization forum on the support board? Lots of styling gurus hang around there and should be able to help you out.
Rick,
Well you are the man. Thanks again for all of your hard work and being active on the comments here. Style & Grace.
Best, Brad
Hi Rick, is there a way to use OpenHook to add tweets in my header? When I add it, it seems to push the entire header down.
Am I missing something?
Well, I can’t say for sure without seeing it in action, but you likely need to add some styling to the tweet so get it to appear where you want.
Assuming the tweet is in a container called
#tweet
, you could use something like this to put the tweet on the right side of your header:That will need to be added to your
custom.css
file, either via OpenHook (if that option is available to you) or via manually editing the file.ack! I tried this and used openhook instead of Notepad++ and ftp to change custom css and now my logo is gone. I’m not sure what I could have done. I added to #tweet lines of code to the custom css and have removed both of them but my logo is still gone.
What seems even more strange is I remembered the last custom.css I uploaded was probably still in my recycle bin. I brought it out and my logo is still gone. Almost like something is stuck and clearing out properly.
OK, so something very strange happened. When I typed in the direct URL to my logo the url showed up in the browser as text. I uploaded my logo again and things seem to be working normally.
Not quite sure if it was an OpenHook issue or not, but this is the first time I’ve used OpenHook for custom.css.
May be a bug?
I wouldn’t expect so; there’s no way that OpenHook could have affected your image file. Not sure what happened there, but I’m glad you got it sorted!
The scope of the Thesis project, what it’s done and what it plans to do, is so vast that it’s easy to assume Mr. Pearson & Co. want to create a new caste of coders/designers/consultants who are keepers of the Thesis secrets. That one of y’all developed this OpenHook panel is direct refutation of that. I wonder if you (or anyone) could give me encouragement that I could single-handedly accomplish my wish-list. I’d appreciate your thoughts. I’m on Twitter as @RickWolff .
2.0 rocks!
Rick,
I love your plugin, thanks! I just upgraded to 2.0, and have this weird issue: the “Execute PHP on this hook” button on the “After Header” hook won’t stay checked! Is this a little bug? Since I’ve got this code there …
… I’m not seeing my Nav Menu at all! I’ve tried all the L.A.Save Buttons, but to no avail. Ideas?
Alec
Sorry, the code is:
php thesis_nav_menu();
Rick,
I nosed around in options.php and found …
and changed “openhook_after_html_php” to “openhook_after_header_php.” That seemed to do the trick.
My first php coding experience!
Yeah, my bad there. OpenHook was the product of close to ten hours non-stop coding going from version 1.1 to 2.0. I got a little cross-eyed at times. I fixed the bug and 2.0.1 should show up in your dashboard for automatic upgrade soon enough. Thanks a ton for reporting it!
Rick,
Absolutely! It gave me an opportunity to learn a little php. And thanks so much for the plugin. It allows hacks like me to look like real experts.
Blessings,
Alec
Thanks for the 2.0 update. Now for a request…how about allowing us to change the name of the “Button” to something else? Even Chris allows that.
I had considered that, but after ten hours of staring at what seemed like a thousand different hooks, I was just happy to release what I had and be done. Maybe in the future. :D
This is amazing! I was going to build another site using a different theme, but now I’m convinced. First thing tomorrow I’ll be upgrading to a developer license. All other themes should just cease to exist — Thesis rules!
I was wondering if I could use “search box” within 404 page instead of error messages. It seems to me OpenHook can customize 404 page.
You can include whatever you want on the 404 page; check out this extreme example (in OpenHook, use the code for “most other WordPress themes”).
However, to include Thesis’ search form, use this function in OpenHook:
Not sure what the styling would like on it, but I’m sure it’s nothing a few style tweaks in your custom stylesheet wouldn’t handle.
Thanks, Rick.
That code works for my blog.
Hey Rick! Thanks for the plugin update. I love it and am learning more and more about using hooks.
Now I need a tutorial on how to use the feature box. (HINT, HINT) :-)
Check out what I’ve done so far here: http://www.jhsiess.com
Suggestions welcome, of course.
Oops … I spoke too soon. Upgraded. But have to revert to the prior version because no matter what I do, new version will not execute php below the header. I have checked the box and re-saved about a zillion times. Same result. I didn’t make any changes other than to upgrade the plugin using the automatic upgrade feature in WP 2.7.1.
Ah, I just realized what the problem is. I have been using version 1.1. WP 2.7.1 is offering an automatic upgrade to version 2.0, not 2.0.1. That’s why I got the error which I not see you wrote about above.
My bad. I should not be doing this at midnight, obviously.
Thanks, Rick.
Tell me! :) Where you could find such support? You’re asking politely Mr. Beckman to continue the support of the plugin because it’s important for you, and in 48 hours he says: “Please receive version 2!” :)
Thank you, Rick! Deleted the old directory, uploaded the new one and it worked instantly, keeping all previous settings :)
Greetings!
Rick:
I find OpenHook to be invaluable to me when I’m designing for clients. For one thing, it speeds the development process, because I can try things and replace things more rapidly than if I was constantly modding the css and php files. For another, it makes the changes more transparent to the client once the files are turned over to them. They still might not have the skills to implement new changes themselves, but it’s less intimidating for them if I send instructions to add something to OpenHook than if I’d said add something to the custom.php file. So, thanks!!
Rick,
Great update to 2.0 — extremely great. One little thing though… pleeeeeeeease bring back the stretchy editing boxes! They were a major part of my workflow, they made my job 100% easier. They make the page shorter (not as much of a big deal now with the multiple save buttons) but more importantly, I work far more efficiently when I can see a screenful of code rather than just 10 lines at a time.
Did those work on WordPress 2.7? Seems as though after I upgraded, they stopped working, and since Chris and I only support WordPress 2.7+ for Thesis, it didn’t seem unreasonable to expect the same with OpenHook.
If I can get a solution working in 2.7, I may add it back. However, I’ll be honest and say that I have no idea how that JavaScript worked — I never got past “Hello world” in learning JavaScript. The resizing script was simply carried over from the plugin that OpenHook was based on.
They worked on WP 2.7, but neither of the sites I’ve upgraded OpenHook on are running WP 2.7.1, so maybe there’s something going on there. I’m moderately decent with javascript, I’ll poke around and see if I can spot anything and let you know if I find anything.
Hey Rick, I figured out a solution. It’s not as slick as the pull-down method, but I think it works even better. I put two buttons under each textarea — one button adds 15 rows to the textarea, the other contracts the textarea by 15 rows. I made a few other minor changes related to this as well, and put a new options.php file up for you to download and check out if you like: Right click and save, then rename the phps file to php. I started commenting on line 235 to explain everything I did in detail. No credit required if you decide to use my changes, just happy to help out.
Is it possible to rename the little ass save button?
It will be in the next version, per my comment above. :D
Thanks for a this great work rick! Two questions though:
1. Is there any easy way to be notified when you’re updating OpenHook (i guess the auto-alert system built in wordpress doesn’t work when you don’t host the plugin in the wordpress.org repository)?
2. Do you have any nice resources where I can find inspiration for all the possibilities this plugin gives us? Like the example for customizing the footer.
Thank you!
Thesis is hosted w/ WordPress, and you should be notified when updates are available. :)
As for resources… Well, skies the limit. You can use just about any markup or WordPress code you could want in OpenHook. Better to know what you want and ask for it then to be given a ton of examples of stuff you probably don’t need, in my opinion anyway. :)
Rick, hi. I think I’m a little confused as to what to put in some spot. for example, say I want to do the nav menu switch from top to bottom of header. What exactly do I enter into the textbox?
Thanks!
The exact code to use is included in OpenHook, listed along with the checkbox for removing the navigation menu from “Above Header.” :)
Another question Rick. I’m trying to put an adsense unit in the content area.
It shows up, but above the content and is not aligned according to my CSS (float:left;)
how would I put this in the content area? Thanks again.
What code are you using? There’s no reason something like this shouldn’t work:
…with this in your
custom.css
file:I tried putting the code in the other, but it had php in it. basically it calls…
adsense_singlepost_top_square.php
and uses the style you mention. hold on a sec… here’s how it’s resolving
and the CSS I’m using is:
#adsense_singlepost_top_square {
float: left;
margin-right: 10px;
}
arrrg, ok so the code didn’t show up. It’s putting the google ad right after the content div and right before the post div.
Do you have a link where I can see this at?
(And when posting code in blog posts and comments, always, always, always escape the code, that way it shows up. :D)
gotcha. here’s the link — http://www.boulardii.net/
Try also adding this to your
custom.css
file:That should do it.
Perfecto!!!!! excellent man. worked like a charm. duh! clear!!! I shoulda know that! Thanks Rick!
Hi Rick,
I’ve been trying to unzip this file and cannot. I’ve deleted it twice and reloaded but to no avail. Any suggestions?
If you’re using WordPress 2.7 or newer (which is required to use Thesis and thus, OpenHook as well), you can install the plugin via the automated installer within WordPress. No need to download the above file at all. :D
Hi Rick,
Not sure why, but I am running WP 2.7.1 and upgraded to your Openhook 2.0 the day you released.
The WP auto installer in my admin is not showing a 2.1 upgrade available.
Any ideas as to what’s up? Should I just DL from here and upload?
Thanks,
Doc
Ooh, my fault. I forgot to change the version in the plugin file itself; no wonder the plugins directory didn’t consider my changes a new version! Thanks for letting me know; I probably would never have noticed this on my own.
I fixed the oversight, and the auto-update should appear soon-ish. However, there’s no harm in doing a manual update if you don’t want to wait. The only change is described in the changelog in the post above, so it may not be a big deal at all for you not to immediately upgrade. No harm either way.
Awesome… glad I decided to point it out.
In no rush, blog working fine, so I will wait for the auto installer. Just love the new auto installer — so much easier!
Thanks again,
Doc
This NextGen Gallery short code [singlepic=1,188,141„right] doesn’t get processed but shows up where the image is supposed to be. Is there a way to use short codes with OpenHook?
The option to parse shortcodes… Now that’s a good feature request! Thanks, dude!
In the meantime, you can get around that shortcoming with this:
Make sure to select to parse that code on whichever box you’re using in OpenHook. Let me know if that fails (and what the error is, if any).
Doesn’t seem to be working. I get [SinglePic not found] but the short code works fine when used on a WordPress page. I just retested it to make sure.
I’m not too familiar with the
[singlepic]
shortcode, but I’m betting what’s happening is that it can only be used within the loop (read: within posts themselves); outside of the loop, the shortcode has no idea which post it’s accessing, which picture(s) it should be referencing, and so on. Not sure. If I can figure out how to trick it, I’ll let you know.Hey there Rick, just a sidenote about a conflict I found after upgrading to 2.0.1 — I’m using the K2 theme while I customize my Thesis site. Well, Openhook causes older post not to show up. I get some conflict with capabilities.php line 920 — not sure if this would concern you too much, but thought you would like to know about it.
just to clarify, the conflict is when K2 is activated. everything is fine with Thesis activated.
I don’t know what I am doing wrong but I can’t get it to unzip. I have downloaded many plugins for wordpress and know what to do but when I try to unzip this plugin it keeps telling me I already have a file with that name. the thesis-openhook file with 0kb gets loaded and the folder with thesis-openhook never gets unzipped.
anybody else have this problem or am i alone
The file works fine for me; however, there’s no reason to download it. Just use the automated plugin installer in WordPress. Search for OpenHook, and it’ll come up to be installed. Easy. :D
thanks , got it. I have never installed a plug-in that way. I like to have them on my system so I can slide them all over in one move on new sites but that works. thanks for the quick response.
Once it’s installed via the automatic installer, you can download it to your comp via file manager. Again, not sure why the downloadable archive above doesn’t work… Does it work if you download it from WordPress’ plugin’s directory? Their archives are automatically generated, so it’ll be ever-so-slightly different than the one I created and have available above.
Rick,
Not sure what I did, but I had the open hook rocking and rolling at http://www.michiganfireservice.com. Then I upgraded the openhook to 2.0, and was running a 1.3 something on thesis. I got error up the wazoo, so I unplugged the open hook and upgraded thesis to 1.4.2 and to 2.7.1 on wp
I plugged in open hook and get
Warning: main(TEMPLATEPATH/lib/classes/options.php): failed to open stream: No such file or directory in /home/content/m/o/b/mobrian/html/mifireservice/functions.php on line 22
Fatal error: main(): Failed opening required ‘TEMPLATEPATH/lib/classes/options.php’ (include_path=’.:/usr/local/lib/php’) in /home/content/m/o/b/mobrian/html/mifireservice/functions.php on line 22
Any ideas?
Not sure why, but there is a
functions.php
file in the root of your site, which is not needed by WordPress, Thesis, or OpenHook. It’s the file throwing the error, so it’s being used by something, which is odd. Try deleting it, seeing what happens.Rick, that worked great, now I just have to fix some hooks that were lost. Not sure if I coded something wired, but I will get it up and running, thanks for your help!
Rick -
Trying to put an image above the title “Home” on the home page only of test site WebChannel33.com. Using Openhook, I can get an image in about the right place by using the Before Content space.
However, I do not know how to invoke the condition that the image should only show on the home page. I tried putting the code below in the Before Content box:
<?php if (is_home()) { ?>
<img src=“http://webchannel33.com/wp-content/uploads/2008/08/480x2701.jpg" alt=“480x270 test image” title=“480x2701” width=“480” height=“270” class=“size-full wp-image-232” />
<p>Text before content, not before content BOX.</p>
<?php } ?>
and checked the box to ” Execute PHP on this hook “. However, the image does not show on any page. (The same test image also correctly appears a few paragraphs down the page, captioned as “480×270 test image”.)
My eventual goal is to get video(s) into the Before Content location, on various pages using conditions. So it seemed to me that first I should try to learn how to place jpg images in the desired location, and later I will work on placement of the video player.
If the error is apparent, please let me know.
Thanks, — E.J.
WordPress’ conditional tags are a bit confusing so far as their names go: If you’re using a page as a home page (rather than your blog) as you are doing,
is_home()
won’t work becauseis_home()
always refers to the blog page. To target your front page, whether it be the default or set to a custom page, you should be usingis_front_page()
. Hope it works for ya. :DRick -
Thanks, it worked.
I had not noticed, until after reading your comment above, that the test image was showing only on the “Blog” page. After making the change you recommended, the test image shows on the home page and only on the home page.
Thank you for your patience towards those of us in an early learning mode.
Best regards,
— E.J.
Hi Rick — I just wanted to let you know about a little glitch I encountered with 404 Title — if I enter this:
and save, the 404 page looks fine, but the next time I see this in the 404 Title (one backslash per quote):
and after the next save I see this (two backslashes per quote):
and then after the next save I see this (three backslashes per quote)
at this point I start getting the expected PHP error:
Warning: Unexpected character in input: ‘\’ (ASCII=92)
Oops, I included the PHP tags and that is obviously a no-no. This is the 404 Title code I added:
echo "Content Not Found";
which got turned into
echo \"Content Not Found\";
and then
echo \\"Content Not Found\\";
and finally
echo \\\"Content Not Found\\\";
You can use Content Not Found in that box; no need to use an
echo
statement. That’ll let you avoid the bug for now. :DI hate slash issues. I’ll take a look at it and may have to roll out another point release. Thanks for reporting this!
Hi Rick,
Thank you for the plugin, I should have started using it months ago. I am currently re-doing my site at blog.chrisstroud.net and have a quick question. I am putting a footer after each of posts and do not wan it to show up on the home page. I know I should be using
if(is_single()) {
some how but do not know how to apply. Any help would be appreciated. Thank you.Well, I could be more specific if I knew what footer code you were using, so I’ll just assume a basic paragraph. Try this out.
That should do it.
Worked perfectly. Thank you.
You’re welcome, dude!
I have tried to insert the following google code into the “before comment meta” hook to no avail. I have enabled php, but nothing ever shows up.
Please escape your code prior to posting it in comments. :)
10 – 4
How’s this:
<?php
if (is_page() )
{ ?>
<script type=“text/javascript”><!–
google_ad_client = “pub-22222222222222”;
/* 468×60, created 2/17/09 */
google_ad_slot = “1694247595”;
google_ad_width = 468;
google_ad_height = 60;
// – >
</script>
<script type=“text/javascript”
src=“http://pagead2.googlesyndication.com/pagead/show_ads.js”>
</script>
<?php }
?>
Much better. :) Now, with that, what’s the link to your site? I like to try to see things “live” if at all possible… Helps me to visualize a solution.
Heads up, everyone: If you’re part of the elite group of legitimate Thesis users (i.e., your copy isn’t pirated), you can now get OpenHook support in a nice, organized environment on the DIYthemes support board. :D
Rick,
Thanks a ton for creating this! I need a little (actually a lot) of guidance. My home page acts as a blog but I want to have specific bit of info show up prior to the begining of the blog entries, not to be confused with info that shows up on every blog post. For example, the page would look like this:
- Static text that doesn’t move (kind of an intro to the site)
— Blog entry 1
— Blog entry 2
— .….….….….
Understand what I’m getting at? Any idea how that can be done?
Hey, Ryan. Glad you enjoy OpenHook! To add content before the posts on the home page, use the “Before Content” box, but wrap your code like this:
<?php if (is_home()) { ?>
YOUR CODE HERE
<?php } ?>