Wordpress contact form 7 shortcode isn't working - wordpress

Title is pretty self explenatory. I use wordpress v4.9.8 with Rocked free theme. I installed contact form 7, no other plugins, and put the shortcode of the base form in a new custom_html widget in the footer-1 area.
Instead of the form, it just shows the raw shortcode. Also tested with twenty-seventeen so I dont believe its the themes fault.
shortcode: [contact-form-7 id="5" title="contact form 1"]

For anyone stumbling upon this from Google, it seems to be a bug in the latest contact form 7 update. The solution is to use the Text widget instead of custom html.
source: https://wordpress.org/support/topic/contact-form-7-not-working-in-footer-after-update/

use a plain text widget to display shortcode content.

Related

Opening Wordpress Gallery from a link

Is it possible to open a wordpress gallery using an anchor tag so that the gallery appears on the same page in a lightbox? I cannot figure out how to do so. It seems like it should be such a simple thing to do but I have tried various plug ins and cannot work out a simple solution.
first, install this plugin
https://wordpress.org/plugins/anything-popup/
Then go to setting->anthing-pop there will be a shortcode http://awesomescreenshot.com/03561dd759
then click to edit it and put the [galley] shortcode
http://awesomescreenshot.com/09261ddfc0
http://awesomescreenshot.com/0ae61ddmb5
Now use the shortcode on click see screenshot
http://awesomescreenshot.com/0de61dej39
you can use the shortcode into post or page or in file like this
<?php echo do_shortcode('[AnythingPopup id="1"]'); ?>
thanks

how can i display contact us page on front page drupal 8?

I am creating scratch theme in drupal 8. Problem is occurred now i want to show contact us block display front page in footer right corner. I had used contact form module but it opens new page. I also used Contact block but result is nothing my concern is that how to does this?
If any one knows, tell me i do not have more knowledge about drupal thanks.
You can use this:-
$block = module_invoke('module_name', 'block_view', 'block_delta');
print render($block['content']);
You define a path to your form admin/content/webform.
Then you define your home page in Site Information admin/config/system/site-information.
More easy, contact block + twig tweak module, get the frontpage node theme sugestion, in my case node 2, -> node--2--full.html.twig and theming it.
content.field_my_field for fields and
drupal_block('mymachinenamebock') -> drupal_block('contactblock') got by the twig tweaks module
You can include the contact form to the footer region by modifying your theme's your_theme_name.theme file.

Where can WordPress (self-installed) shortcodes be rendered?

I've looked around for this but can't seem to find a definite answer. I want to know where WordPress shortcodes are supported within the (self-hosted) platform - meaning where can I safely place shortcode content and expect it to be rendered? I know I can use them in post and page content, and some widgets that output something. But can I use them in other plugins (that also output something), and which widgets are supported? Do custom plugins need to have something enabled that allows them to render shortcode content?
This page says:
By default, WordPress does not support shortcodes within Sidebar Widgets. It only expands the shortcodes within the content of a Post, Page, or custom post type.
... although I've gotten shortcodes to work in the arbitrary text widget, so that information doesn't seem accurate. It also suggests I install this plugin that hasn't been updated in years.
Is there any clarification somewhere on this that I've missed?
You can use:
<?php do_shortcode('name_of_shortcode'); ?>
e.g echo do_shortcode('[gallery autoplay=no]');
and it will render this shortcode. You can place it in functions.php, header.php, footer.php.
EDIT:
If you want it to work in Text Widget, all you need is to add this line of code in functions.php file:
add_filter('widget_text', 'do_shortcode');

Wordpress static Form on any page - Plugin, Widget or Shortcode?

I am frankly new to wordpress but programm in PHP.
Task:
I have a form (don't wanna use a form plugin) and want to include this form on either 1. Sidebar or 2. within content of any Page except one (Contact-page).
I want to programm the Widget, Shortcode or Plugin bymyself. I don't need a tutorial how to programm this.
Question:
What do you advise me to use: a shortcode, plugin, widget or a "hack" in the template (f.e. if ($page!=="contact"){...}
The answer should consider
Ease and flexibility of use
Short time to develop
Speed of Rendering
Thanks for advise of experienced Wordpress Users/Developpers.
PS: the form is very simple maybe there is even another fast way you know how to do this.
Try This
1)first to fall you make a page templates of contact page.(make copy of page.php than only change the name of templates)
2)than that template in you make your custom form.
3)that page template you apply in your contact page.
Make a template-myForm.php file, and populate it with following:
<?php
/**
* Template for displaying search forms for My Web Site
*
*/
?>
<form role="search" method="get" class="search-form" action="<?php echo home_url( '/' ); ?>">
<!-- your form content-->
</form>
Add to site <?php get_template_part( 'template', 'myForm' ); ?> where you want a custom search form. I used it for search form, so it was easy to make it into widget also. I used separate template file for site search, and searcform.php for search widget. If you are aiming at different kind of form tag, you have to create that a Widget.
It is a class Your_Widget extends WP_Widget, which for you can find tutorials on your own, or just check out PHP code file: wp-includes/class-wp-widget.php in your Wordpress copy and extend it. Me personally use tutorials. I find it more simple.
So, to summ up, you would have two copies of your form - one to show as a template part, and an another one for sidebar or other registered widget area. If it is identicall in both versions, using this solution you would have to remember to keep changing it in two places (which is again simpler than hard-coding).
For me beeing not a native English speaker and just a part time Wordpress coder, this is what I offer. More integrated and PHP-programming-friendly solution, find in Wordpress forums, here on stackoverflow and Wordpress.org site.
I also am aware this is not exactly what you are looking for - not using shortcode. I hope this will kick you off into Wordpress world, and you will find how to offer a custom form to your users!
Good luck!

shortcode in model page in twentytwelve theme?

I create a page in the model twentytwelve theme and I install the plugin cool video galery. my problem if I create it shows me the shortcode, not the video, how do I correct the problem?
Have you try to use do_shortcode function for using shortcode in Template.
So, Suppose if you short code is [cvg-gallery galleryId='gallery-id'] then wrap it with do_shotcode. Like
// Use shortcode in a PHP file (outside the post editor).
echo do_shortcode('[cvg-gallery galleryId='gallery-id']');
And then use it in template or in Lightbox.

Resources