Save Textarea on WordPress Frontend

You can use Javascript to save to localStorage which allows you to store a fair amount of data locally. The amount differs between browsers, but I believe it’s generally between 2MB and 5MB which is typically more than enough. Here’s some documentation by Mozilla on localStorage: https://developer.mozilla.org/en/docs/Web/API/Window/localStorage And here’s a table of storage capacity for … Read more

Remove header title form page through CSS [closed]

To hide the title (Winkelwagen) from that page: This is the CSS that you want to run: .c12.end.pageheading { display: none; } You can add that to your child theme’s style.css, or you can add the following to your child theme’s functions.php: add_action( ‘wp_head’, ‘hide_winkelwagen’ ); function hide_winkelwagen() { ?> <style itype=”text/css”> .c12.end.pageheading { display: … Read more

Customizer – How to get theme mod range value?

I was able to get the value of the range slider to save and display by changing the sanitize_callback value to a custom function that returns an integer value: $wp_customize->add_section( ‘range’, array ( ‘title’ => __( ‘Range’, ‘textdomain’ ), ‘priority’ => 45, ) ); $wp_customize->add_setting( ‘range_field_id1’, array( ‘default’ => ”, ‘type’ => ‘theme_mod’, ‘capability’ => … Read more

Can ‘edit_form_after_editor’ messages be varied for specific pages?

The edit_form_after_editor action delivers a (WP_Post) Post object as a parameter if you initiate the add_action the right way. After your function name you can set the priority and amount of accepted arguments (read more here). function add_screen_message($post) { if($post->post_type==’page’) { echo “<p class=\”edit-message\”>Custom message here.</p>”; } } add_action(‘edit_form_after_editor’, ‘add_screen_message’, 10, 1); The example above … Read more

WordPress custom dropdown listings

Populate your data something like this and and you can use Javascript/jQuery to achieve this. <select class=”apple_store_location”> <option value=”1″ data-url=”http://mysiteurl.com/1″> Place 1</option> <option value=”2″ data-url=”http://mysiteurl.com/2″> Place 2</option> <option value=”3″ data-url=”http://mysiteurl.com/3″> Place 3</option> <option value=”4″ data-url=”http://mysiteurl.com/4″> Place 4</option> <option value=”5″ data-url=”http://mysiteurl.com/5″> Place 5</option> <option value=”6″ data-url=”http://mysiteurl.com/6″> Place 6</option> <option value=”7″ data-url=”http://mysiteurl.com/7″> Place 7</option> </select> <script> //Using … Read more

WordPress Code Snippet to count total posts by author

First of all you need to get all users calling get_users() function. Then you can use count_user_posts() to display post count for a user. Try below code. <?php $blogusers = get_users(); // Array of WP_User objects. foreach ( $blogusers as $user ) { echo ‘Number of posts published by ‘.esc_html($user->display_name).’: ‘ . count_user_posts( esc_html($user->id) ).'</br>’; … Read more

wordpress shortcode not working

Point-1: it’s not clear where you are getting $order_id from. I’m assuming it’s in the Shortcode. Point-2: You don’t need to. use ob_* functions for returning Shortcode replacement content, simply returning is enough. Assuming other parts of your CODE is correct, below is the possible CODE that should work: If the shortcode is implemented in … Read more