nofel — 2013-07-18T04:36:40-04:00 — #1
I am using wordpress to have few lines of code to show up in dialog box but till now no success. I tried .show() of jQuery and its working but doesn't work if i change it to .dialog() or popup(), anyone got any idea how its not working and what should i do to make it work.? here is Fiddle
pullo — 2013-07-18T04:46:27-04:00 — #2
Are you trying to display a contact form in a Lightbox?
nofel — 2013-07-18T04:47:41-04:00 — #3
yes, i have some other things too in div, i just want a lightbox or dialog to work.
pullo — 2013-07-18T04:48:49-04:00 — #4
I had to do something similar a while back.
I wrote it up in this blog post.
Maybe that'll help you.
nofel — 2013-07-18T04:51:34-04:00 — #5
Does formlightbox have a do_shortcode?, as you see in my fiddle that i have using it my template in php echo statement
pullo — 2013-07-18T04:58:25-04:00 — #6
[formlightbox title="Send me a message" text="Contact me"]
[contact-form-7 id="401" title="Contact form 1"]
nofel — 2013-07-18T05:56:52-04:00 — #7
here is my code
echo do_shortcode('[formlightbox title="Send me a message" text="Contact me"]')
echo do_shortcode('[contact-form-7 id="36" title="Contact Attorney"]')
The light box work but it doesn't display contact form, instead its showing on the page, whereas i want it to open when i click the button, am i doing something wrong?
pullo — 2013-07-18T06:08:03-04:00 — #8
Try putting everything in one statement:
<?php echo do_shortcode('[formlightbox title="Send me a message" text="Contact me"][contact-form-7 id="36" title="Contact Attorney"][/formlightbox]'); ?>
nofel — 2013-07-18T06:40:54-04:00 — #9
It worked! thanks a ton! but like i said i wanna have some html side by side the form, now how do it do it?
nofel — 2013-07-18T07:14:16-04:00 — #10
Is there any documentation for the lightbox? now i am trying to have a button that is clicked upon to have the lightbox opened but the button between shortcodes display in popup, where as i need the one outside to work
<button id="contact">Contact Us</button>
<input type="button" value="Contact Us">
[contact-form-7 id="36" title="Contact Attorney"]
sorry to ask again, i am not good in php
pullo — 2013-07-18T07:18:01-04:00 — #11
Contact Form 7 wraps its content in a div with a class of "wpcf7".
I would first of all try to append something to that.
When you get that working, put your content in a template div like so:
Lots of content to go next to the form
$template = $("#template");
nofel — 2013-07-18T07:23:54-04:00 — #12
Only problem is i don't know where to put these and make it run
pullo — 2013-07-18T07:24:46-04:00 — #13
Could you then post a link to your page?
nofel — 2013-07-18T07:33:06-04:00 — #14
here, nothing fancy. just using get_template_part above that code to make the page come together,
here are 2 issues,
- I need to make the button open the lightbox
- I will be doing a div where one div will float left containing the contact form and second div run side by side to run some text, so its like parallel.
pullo — 2013-07-18T07:36:41-04:00 — #15
Sorry, don't you have a link to the page you are developing using WordPress?
The reason for needing this, is that JSFiddle will not evaluate the shortcode, whereas Wordpress will.
It will then add a bunch of divs etc to the source code which we can target with jQuery.
nofel — 2013-07-18T07:52:19-04:00 — #16
I have it on localhost only
pullo — 2013-07-18T08:00:26-04:00 — #17
Ok, well try adding it to your document just before the closing body tags.
To be on the safe side wrap it in a call to document.ready(), although this probably isn't necessary.
nofel — 2013-07-18T08:07:42-04:00 — #18
didn't work, here is my code
your right, i was able to do it in do_shortcode but too many divs. Is it possible to open the lightbox with click on a button, instead of hyperlink ?
pullo — 2013-07-18T08:26:28-04:00 — #19
On the form-lightbox project page, they have an example (no. 7) using an image to open the lightbox on click.
I would think you could probably adapt that to use a button instead.
nofel — 2013-07-18T16:39:06-04:00 — #20
i tried that but the button displays inside the form. any idea how to fix it? I assume i am echoing the shortcode, that is why it is inside the dialog.
next page →