Shortcode Not Implementing In TopBar Menu - shortcode

I have a shortcode for currency switcher in wordpress which im trying to get it implemented to the top bar menu and when i try to do it it just simply displays the shorcode rather than having the dropdown list for multi currencies [woocommerce_currency_switcher_drop_down_box] Heres the shortcode and https://snipboard.io/3SjMre.jpg here's the ss for wwhat how the problem occurs for the website https://executiverugs.com/ . I got no support from theme as it got expired and this shortcode isnt implementing in the topbar menu. Help Please

try editing the header.php file.
add following code to the file below the opening <body> tag at the place where your shortcode now is
<?php echo do_shortcode('[woocommerce_currency_switcher_drop_down_box]'); ?>
will do the trick

Related

Using Get Element By ID

I'm trying to set/add a class name to a div by targeting its ID but I'm not having much success at the minute.
I basically have my website navigation saved to an external file so all I need to do is make changes to one file to update all pages, but doing this restricts my website users from being able to easily identify which page of the site they are on.
I have a class="current" option that visually tells the user where they are in the menu but I can't for the life of me add the class to the navigation menu. I'm trying to run the code after the nav menu file is loaded in using the following code, where am I going wrong?
<?php include_once ("includes/page_top.php"); ?>
<script type="text/javascript">
document.getElementById('home').className("current");
</script>
className isn't a function.
Instead of this:
document.getElementById('home').className("current");
You want this:
document.getElementById('home').className = "current";

TinyMCE get form content without using submit button

I'm trying to put TinyMCE on my website. I figured out how to get it to show up, but I'm lost on how to process the content. In their example, they just have a link that references the top of the page and clicking on it somehow magically causes their dump.php script to execute. I don't understand what's going on here. Here is the link:
http://www.tinymce.com/tryit/basic.php
The "Submit" button at the bottom is really a link in a span element with href="#". The form action is dump.php. I want to know how they configured this to run without an actual submit button. Any help in understanding this is greatly appreciated!
To Get Content From Tinymce You Can Use GetContent Method of Currently ActiveEditor Instance
tinyMCE.activeEditor.getContent();
method is used to getting Content .. to Set The Content
tinyMCE.activeEditor.setContent("I Want Text To Be in Tinymce");
to find a perticular element in tinymce get body and find element
var body = tinyMCE.activeEditor.getBody();
$(body).find("#elem_id")
to get a full html
tinyMCE.activeEditor.getDoc().documentElement.innerHTML
hope that helps ..
Since I use PHP, I found this which is also useful:
http://www.tinymce.com/wiki.php/TinyMCE3x:How-to_implement_TinyMCE_in_PHP

How to add a basic signup form to a Concrete5 page template

I'm new to Concrete5 and have found a ton of information on adding contact forms, but only to the editable area of the page.
What I need to do is get a form into my page template. It's simply a name+email+submit button form to appear on every page for that template. On submission, a 'thanks' message... that's about it!
I've tried copy/pasting the code outputted into the page content to my default.php template but no luck with that. Thanks in advance for any help.
You should create a (global) editable area in the template, and then add a contact block to it just as you would otherwise.
E.g.:
<?php
$a = new GlobalArea('Contact Form');
$a->display();
?>
I agree with the other answer here... it's not worth the trouble to re-create a "hard-coded" contact form in your theme if you already have all the code working as a block. Here's a third technique you could use to achieve that -- you can hardcode just one block instead of the entire stack, like so:
<?php Block::getByName('My Global Contact Form')->display(); ?>
Put that code in your theme's template, and then add the contact form block to a stack in the dashboard (any stack, doesn't matter -- I usually create one stack of "global content" in my sites that I put all of these "hardcoded" blocks into). Then after you've added the block to the stack, click on the block and choose "Custom Template" from the popup menu. Then enter the block name into the field there (in this example, it would be "My Global Contact Form", without the quotes). Finally, click the "Approve Changes" button at the top of the stack.
You could approach this a couple of ways, but one way is to create a stack that has an contact form in it. Then, take the name of that stack and add it to your template.
So if the stack is called "Global Contact Form", then you could add the following to your template:
$stack = Stack::getByName('Global Contact Form');
if( $stack ) $stack->display();

Zend Framework: How to add custom html to Form Element?

I want to add Custom HTML ("Login" link near the "Register" button) in Register form with ZF 1.12.
When I do that with:
$submit = new Zend_Form_Element_Submit('register');
$submit->setDescription(" or <a href='auth/login'>Login</a>");
... then the link is placed in the next row, but I need it close to the "Register" button.
How can I implement it as simply as possible?
You have to create a custom form decorator for that. It is not that simple. If you have no other option then its better to create new decorator and add it to the form element. The ZF manual have a good documented section for that Creating Custom Form Markup Using Zend_Form_Decorator. This SO post will help too Insert custom HTML into Zend_Form.
there is also a quick workaround using javascript (if you are using jquery)
$(document).ready(function() {
$('#register').after(' or Login');
});
The description for the submit button, should surely be something more like:
'Activate button, to register.'
Arguably the login link isn't directly related to the form either. So I'd just place that text after the form.
<?php echo $form; ?>
<p>Or <a href='auth/login'>Login</a></p>
If you think the login link should always belong to the form, you could perhaps add it to the form description.

nyroModal v2: How to validate form opened in iframe?

I'm trying to figure out how to validate a form opened using nyroModal.
The page is being opened as below on click of a button:
$(function() {
$('.btnedit').click(function() {
$.nmManual('form_page.php);
});
});
On the form that opens up, I have a few fields that are mandatory and a cancel & submit button.
<a class="nyroModalClose button" href="#" id="btn_submit">Submit</a>
On clicking of the submit button, I want to make sure the mandatory fields have value. If no, an error message should be displayed & the modal window should not close.
I'm trying to use the jquery validation plugin, but without success. The modal window always closes irrespective of the validation scripts.
I haven't found much info regarding form validation in a modal window. Is this not a preferred approach?
Thanks in advance.
I'm not able to help you about the jquery validation plugin in a modal window, but I know that using the instruction $.nmManual in that way, the form will not be placed inside the iframe tag, and if I remember correctly the content of new page will be added without header and body tags, so in a word incorrectly. I guess this can produce no validation.
To successfully open an iframe you need to use filters as described here:
Open iframe manually in nyroModal?
I hope this can help you.