Wordpress Mobile Menu Plugin - wordpress

https://tr.wordpress.org/plugins/mobile-menu/
the plugin I am using
But my problem, Plugin search link;
mywebsite.com/?s=searchtitle
but what I want;
mywebsite.com/?s=searchtitle&post_type=product
I think it might be relevant code section;
$header_search = '<i class="mob-icon-search-6 mob-search-button"></i><i class="mob-icon-cancel mob-search-cancel-button"></i>';
$header_search .= '<div class="mobmenu-search-holder"><form class="mob-menu-search-form" action="" method="get">
<input type="text" name="s" class="mob-menu-search-field" placeholder="' . $titan->getOption( 'placeholder_text' ) . '" autofocus="">' . $search_button . '</form></div>';

I'm author of WP Mobile Menu. You can achieve this in several ways.
Try the solution in this topic.
https://wordpress.stackexchange.com/questions/223576/changing-a-themes-search-function-to-only-show-results-from-woocommerce

Related

Field no longer required when use image as radio button on contact form 7

I use this tutorial Use image as radio button on Contact Form 7 to put images instead of radiobuttons and it works well but now the field is no longer required. I don't want that users are able to submit the form without select option from the image/radio button.
Any ideas on how to solve this ? Theme used is Storefront with Boutique child theme. May be a conflict with a hook ? I don't find
Thanks
It would help to see your code but if it is a copy from the link you provided, it would look like this:
$datalist .= sprintf(
'<label><input type="radio" name="%s" value="%s" class="hideradio" /><img src="%s"></label>', $tag->name, $radiovalue, $imagepath
);
try adding "required" to the input like this:
<input type="radio" name="%s" value="%s" class="hideradio" required="required" /><img src="%s">
Let me know if that works.

Searching an external website from Wordpress search

I'm trying to change the search functioanlity of a Wordpress website so it searches an external website instead. While I've been able to change the form action to use the external websites URL, I haven't been able to get the right search results. Here is the code I'm using:
<div class="et_search_outer">
<div class="container et_search_form_container">
<form role="search" method="get" class="et-search-form" action="https://www.premierkitchenandbathgallery.com/search.htm?S1=">
<?php
printf( '<input type="search" class="et-search-field" placeholder="%1$s" value="%2$s" name="s" title="%3$s" />',
esc_attr__( 'Search …', 'Divi' ),
get_search_query(),
esc_attr__( 'Search for:', 'Divi' )
);
?>
</form>
<span class="et_close_search_field"></span>
</div>
As noted above, I'm attempting to search Premiere Kitchen & Bath using https://www.premierkitchenandbathgallery.com/search.htm?S1=
However, every search seems to fail, showing:
"We're Sorry!
Your search for ""
did not match any results.."
So either the search term isn't being passed, or I'm not using the correct search string. Any suggestions? Here is the website I'm searching from, if you want to test - http://premierkitchen.solutioserver.com/ (use search bar in the menu)

Option page not updating multiple records in settings api

Hi i am new to wordpress plugin development. i have issues with settings api. please help if you can.
Below is my problem.
The problem i am facing is the last record which is link it is updating in database but the title text is not updating in database.
So please help me find solution. Thank you.
function load_plugin() {
add_settings_section('plugin_main', '<h1>Ticker Settings</h1>', 'plugin_section_text', 'plugin');
add_settings_field('plugin_text_string', 'Title text', 'plugin_setting_string', 'plugin', 'plugin_main');
add_settings_field('post_title_link', 'Link', 'plugin_link_setting', 'plugin', 'plugin_main');
register_setting('plugin_options', 'plugin_options');
register_setting('post_title_link', 'post_title_link');
}
function plugin_section_text() {
echo '<p>Change your post ticker title and give link to.</p>';
}
function plugin_setting_string() {
echo "<input id='plugin_text_string' name='plugin_options' size='40'
type='text' value='" . get_option('plugin_options') . "' />";
}
function plugin_link_setting() {
echo "<input id='post_title_link' name='post_title_link' size='40'
type='text' value='" . get_option('post_title_link') . "' />";
}
add_action('admin_init', 'load_plugin');
function post_ticker_setting() {
?>
<div class="wrap">
<form action="options.php" method="post">
<?php
settings_fields('plugin_options');
settings_fields('post_title_link');
do_settings_sections('plugin');
?>
<input name="Submit" type="submit" value="<?php esc_attr_e('Save Changes'); ?>" />
</form>
</div>
<?php
}
You have to register all settings with register_setting (https://codex.wordpress.org/Function_Reference/add_settings_field). The register_setting lines you show don't correspond to your fields.
Also sections should be declared after the fields are registered (https://codex.wordpress.org/Function_Reference/register_setting)
In your code, the following lines
<?php
settings_fields('plugin_options');
settings_fields('post_title_link');
do_settings_sections('plugin');
?>
don't correspond to the declarations above:
add_settings_section('plugin_main', ...
add_settings_field('plugin_text_string', ...
add_settings_field('post_title_link', ...
Only the 'post_title_link' has the same name. Which is probably why it is the only one updating.

display multiple feature images through custom post type with shortcode

I have a shortcode/multiple feature image problem I'm hoping for a bit of help on.
My custom post type called rubow_medarbejder is displayed on a page with a shortcode. This works fine.
I need to add a second feature image. I've used the Multiple Featured Images plugin to do this. Problem is I can't get the image to display through my shortcode.
kd_mfi_get_featured_image_id() shows the id perfectly but when I type kd_mfi_get_featured_image() it brings this error message
Fatal error: Call to undefined function kd_mfi_get_featured_image() in /var/www/www.rubowarkitekter.dk/www/wp-content/plugins/Medarbejdere/medarbejdere_post_type_shortcode.php on line 22
The output part of my shortcode that provokes this error looks like this
$output .= '
<div id="medarbejder">
<div id="medarbejder-page-content-gray">' . kd_mfi_get_featured_image( 'hover-medarbejder-image-grayscale', 'rubow_medarbejder') . '</div>
<div id="medarbejder-page-content-img">' . get_the_post_thumbnail() . '</div>
<div id="medarbejder-page-content-navn">' . $meta['rubow_medarbejder_navn'][0] . '</div>
<div id="medarbejder-page-content-titel">' . $meta['rubow_medarbejder_titel'][0] . '</div>
<div id="medarbejder-page-content-telefon">' . $meta['rubow_medarbejder_telefon'][0] . '</div>
<div id="medarbejder-page-content-mail">' . get_the_content() . '</div>
</div>
';
Any hints to get this solved would be highly appreciated. Thanks!
Use Advanced Custom Fields plugin. Then add as much custom fields as you need. and use
echo get_field('my-other-featured-image');
To output.
You need to select image url and size in plugin to output like that.

Wordpress Widget options saving doesn't work

I want to have changeable widget title via Options Panel in wp-admin > Appearance > Widgets.
It doesn't seem to work, after clicking "SAVE" it always gives back the default instead of saving stuff.
Widgets control panel is very simplistic:
function myplugin_control() {
echo '<p>
<label for="myplugin_title">Title:</label>
<input id="myplugin_title" name="myplugin_title" type="text" value="Default title:"/>
</p>
<p>
<label for="myplugin_number">Number of items to show:</label>
<input id="myplugin_number" name="myplugin_number" type="text" value="5" size="3"/>';
$myplugin_title = ($_POST["myplugin_title"]);
$myplugin_number = ($_POST["myplugin_number"]);
update_option('myplugin_widget', $myplugin_number , $myplugin_title);
}
And plugin goes like:
(...)
function widget_myplugin($args) {
extract($args);
echo $before_widget;
echo $before_title . $myplugin_title . $after_title;
myplugin();
echo $after_widget;
}
I think you're using update_option(); improperly. It only takes two values. http://codex.wordpress.org/Function_Reference/update_option
Try change the name of your title field to simply "title". I think WP looks for this by default; see: http://wordpress.org/support/topic/how-can-i-set-a-widgets-title-in-for-use-in-the-dashboard
Instead of using $_POST['title'], use the more standard $this->get_field_id('title'); and echo $this->get_field_name('title');
Hope this helps! Also: you may find the following link helpful: http://wpengineer.com/1023/wordpress-built-a-widget/

Resources