Jump to content
Sign in to follow this  
WebWerx

Hooks - Need Someone Smart to Validate my Code

Recommended Posts

WebWerx

I am just working on creating a hook to add a Search Box to the top right of my site. This is what I have: // HOOK to ADD Search Box to Upper Right of Site // add_action('pagelines_before_branding_icons', 'new_search_bar'); function new_search_bar(){?> <?php get_search_form();?> <?php } // End Function // It works fine. But as it is my first hook, I want to be certain that I have not missed anything. Need someone nerdier than me to vette my work. [-O< PS The site is a mess at them moment - so I know

Share this post


Link to post
Share on other sites
Simon
Looks ok, but you dont need to needlessly open and close php tags, plus wrap code in code tags in the forum so we can read it, or use the pagelines pastebin ;) http://paste.pagelines.com/39

Share this post


Link to post
Share on other sites
WebWerx
Funny that Simon: I had placed a bet with myself as to who would reply and how long it would take. I won a Guinness (to be consumed this evening!). :ar! So the link you posted in Pastebin (cool stuff BTW) has the correct code syntax? Followup Q: How does one apply Divs correctly to the code in question.

Share this post


Link to post
Share on other sites
Simon
[code]echo '
';[/code]

Share this post


Link to post
Share on other sites
WebWerx
@pross (Simon): Like this: http://paste.pagelines.com/59 $-)

Share this post


Link to post
Share on other sites
Simon
almost, you want the dive before the search tho ;) then a
after it.

Share this post


Link to post
Share on other sites
WebWerx
@pross: Better?: http://paste.pagelines.com/9z You will whip me into shape yet! This is my first experience with PHP :((

Share this post


Link to post
Share on other sites
Simon
http://paste.pagelines.com/4j

Share this post


Link to post
Share on other sites
WebWerx
Got it! It is in "the vault" @pross I really appreciate the tutelage. And it all makes perfect sense. Me thinks I'll be reading up on PHP very soon!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×