Search only working on front page (index) , not working on other pages

Currently your form looks like: <form id=”search-query”> <p class=”in-english”><a href=”http://localhost/hermodswp/?page_id=76″>Information in English</a></p> <div class=”search-box”> <div> <label class=”screen-reader-text” for=”s”></label> <input type=”text” value=”sdf” name=”s” id=”s” style=”width: 293px;”> <input type=”submit” id=”searchsubmit” value=”Sök”> </div> </div> </form> Try adjusting your submit action to point to your home_url(). action=”<?php echo home_url(); ?>” You can edit the page in Chrome to see … Read more

How to create a form button that executes a function?

This is a simple example of rendering some items on the front-end that use AJAX to trigger changes in the back-end and update the UI from that response. There are other examples that enqueue scripts so just read up on AJAX and consider this a high level view. REGISTER AJAX/SCRIPTS/CSS add_action(‘init’, function () { // … Read more

Simple php in wordpress widget [closed]

add_action( ‘wp_dashboard_setup’, ‘register_my_dashboard_widget’ ); function register_my_dashboard_widget() { wp_add_dashboard_widget( ‘net_profit_widget’, ‘Net Profit Calculator’, ‘net_profit_widget_display’ ); } function net_profit_widget_display() { $subPrice = 0; $subnumb = 0; if (array_key_exists(‘subprice’, $_POST) !== false) { $subPrice = $_POST[‘subprice’]; } if (array_key_exists(‘subnumb’, $_POST) !== false) { $subnumb = $_POST[‘subnumb’]; } $payperc = “2.9”; $paystan = “0.3”; $netprof = “N/A”; $expense = … Read more

PHP- Why is my contact form keep showing it is invalid? [closed]

You should remove the <meta http-equiv=\”refresh\” content=\”0;URL=contactus.php\”> from your document head section, first. The problem Each time you press submit button on your form, you call chkContact where you do an ajax call. You should put an if before the ajax, so that it would not get executed if the form is invalid. if( form … Read more

How do I make multiple dependent input fields that use the jquery autocomplete function?

Add a autocomplete ‘select’ catch to your first autocomplete field. Use this to get the chosen value from the autocomplete. Use an Ajax call to obtain your next autocomplete source based on the selected value and apply the new source to the next autocomplete field. jQuery( “#cns-make” ).autocomplete({ source: availableTags, select: function (event, ui) { … Read more

form built dynamically with php, not submitting

Your form does not contain an ID. You need to replace name=”form1″ with id=”form1″. This is because your javascript says, onclick=”document.getElementById(“form1″).submit();” which returns False, because there is no form with the ID “form1”.

Adding Additional Variables on Menus Page

Use the checked function. https://codex.wordpress.org/Function_Reference/checked The HTML you want to render should look like this: <input … value=”hide” checked=”checked” />Hide from these locations.</br> <input … value=”show” />Only show to these locations.</br> What you’re getting instead is probably somthing like this: <input … value=”hide” />Hide from these locations.</br> <input … value=”” />Only show to these locations.</br> … Read more

How can I modify labels in default wordpress registration form? [duplicate]

If you are using default WordPress registration form. But there are no “Email” field. OK but you can try below code. if ($pagenow==’wp-login.php’) { add_filter( ‘gettext’, ‘user_email_login_text’, 20, 3 ); function user_email_login_text( $translated_text, $text, $domain ){ if ($translated_text == ‘Email’) { $translated_text=”Email required field”; } return $translated_text; } }

File Uploader – Upload without adding to Media Library

HTML Okay, you’ll of course want to set up an HTML file. I would use this code or something like it: <form action=”upload.php” method=”post” enctype=”multipart/form-data”> Select image to upload: <input type=”file” name=”fileToUpload” id=”fileToUpload”> <input type=”submit” value=”Upload Image” name=”submit”> </form> Of course, you don’t have to use upload.php as your filename, that’s just what w3schools used. … Read more