How to change the "Woocommerce Status" text in dashboard widget

I want to change the "Woocommerce Status" text in dashboard widget. See the image: I found this code in http://stackoverflow.com but it not working. function change_add_to_cart_message( $translated, $text, $domain ) { global $pagenow; if( $text === 'WooCommerce status' && $domain === 'woocommerce' && is_admin() && $pagenow === 'index.php' ){ $translated = __( 'WooCommerce summary', $domain ); } return $translated; } add_filter( 'gettext', 'change_add_to_cart_message', 10, 3 );
Category: Web

Display widget outside sidebar?

I want to display a widget outside the sidebar, but I can't get my code to work. The theme name is radius-primary-sidebar and my widget id is text-20 (according to the html in the admin page. See image #1). I've tried using the_widget("radius-primary-sidebar", "widget-id=text-20"), but that didn't return anything. What I'm I doing wrong? I'm using wordpress 3.5.2. From /wp-admin/widgets.php in the admin panel.
Category: Web

Need to add custom text field to Woocommerce under add to cart button

I'm a WP newbie so please stick with me here. I handle this online catalog of products and we need a custom input field to go beneath our invisible "Add To Cart" button. The text needs to be changed per product. On the Single Product Page Customizer there is the option to add text after the cart button, but it's a static line of text and not editable per product. Any help would be amazing.
Category: Web

Text widget doesn't save the content

I am trying to save data in the default text widget. But when I click save, all the data are not saving and the field becomes empty. It happens when I edit in title field or text field. As I new to WordPress, I don't know the solution. I haven't installed any cache plugins. I haven't done any changes in functions.php or anywhere.
Category: Web

Widget without DIV wrapper

Whenever I add a text widget it adds a div around the content I add. E.g. <div class="textwidget"> <my content> </div> which messes up the formatting of some of my content. Is there a way to NOT have the surrounding div? i.e. a widget that just outputs without any surrounding divs?
Category: Web

How to change widget title in wordpress version 5.8.1?

Maybe this is a novice question but I am stumped. I am trying to change the title of a widget (recent posts) in WordPress 5.8.1 version. I have installed WordPress after a long time again and can not seem to find the option to change a widget title. How to do this? Please remember that I do not want to change the title programmatically as I can do that. Just want an easy point and click option like the old …
Category: Web

How to run php code only for a specific widget on a page and not all widgets on that page?

I want to display extra information below the post title only for the posts widget on the home page and not the portfolio widget. I'm using Wordpress' the_title filter to do this and that works fine, but at the moment, it shows the extra info in both the portfolio and the posts widgets. I need a condition to restrict the filtering only to the posts widget. The post widget's class name is "home-post-widget" My current code looks like this. function …
Category: Web

Widget Text Needs to be White

I need to change the color to white on the title of a widget that I have in my footer. I looked at the source code and note that it says H4 before and after the text. However, when I change the color of H4 in the global typography, it does not change the color of this widget text. I also found the area for the Widget Header and changed it to white but it also is not changing the …
Category: Web

Plugin translations not installed but... strings are translated!

I've had for a long time a site with the famous Recent Tweets Widget. The plugin came as part of a theme, and back in the day, it included translation .po and .mo files for French language. I didn't pay attention to this before. But recently I have found that the strings indicating the tweet's age (x days/months ago, etc.) are translated into Spanish, main language of the site. I have confirmed that the translated strings are not in the …
Category: Web

How to get individual values from custom widget?

I have the following custom sidebar: I want to know if it's possible to get the values stored in each widget individually. I already tried doing the following: global $wp_registered_widgets; $widgets = wp_get_sidebars_widgets(); echo "<pre>"; var_dump($widgets['footer-1']); foreach ($widgets['footer-1'] as $widget) { var_dump($wp_registered_widgets[$widget]); } echo "</pre>"; But the first var_dump only returns: array(5) { [0]=> string(10) "nav_menu-2" [1]=> string(6) "text-2" [2]=> string(6) "text-3" [3]=> string(6) "text-4" [4]=> string(6) "text-5" } And the var_dump inside the foreach only returns this properties: array(7) …
Category: Web

Disappearing Widget Text area

I recently encountered a strange thing for the first time with Wordpress...all of my text boxes in every widget sidebar disappeared! Other widgets are still there. Has this happened to anyone else? I am using 10 different sidebars on 10 different templates and all text widgets have failed. Is there a limit to how many sidebars you should have? What else could be the problem?
Category: Web

Change values on several pages

I'm building a catalog website that shows products, they are present on several pages and each time i want to change some details i have to enter to each page and change. Is there any solutions to link this particular value to a variable that i can change it one time and affect on all the other pages. Bests, Amine
Category: Web

Text widget is placing everything side by side. I want to post it above

As I add text widgets within a page in my home screen, They are going side by side. I have three text widgets as if there are three columns of text in my page. I like this, but i want to put a title above... so I want to add another text widget. Once I add this text widget, it appears as another column on the right. Where would i go to fix something like this? do i make the …
Category: Web

Change The Woocommerce Product Categories Dropdown Widget Placeholder Text

I've searched everywhere on the internet and tried to code it myself I want to change the default "Select A Category" placeholder text to "Select A Sub Category" so far I have tried this but it's not working: function _category_dropdown_filter( $list_args ) { $list_args['show_option_none'] = __('Select A Sub Category'); return $list_args; } add_filter( 'woocommerce_product_categories_widget_arg' , '_category_dropdown_filter' ); Also, I have even tried to edit this file here but I see no "Select A Category" woocommerce/includes/widgets/class-wc-widget-product-categories.php
Category: Web

WP - Genesis - How to get the content of a widget in php?

Provided I have a widget area that I register in genesis like this: genesis_register_sidebar( array( 'id' => 'my_header', 'name' => __( 'Image Header', 'my_header' ), 'description' => __( 'do it', 'my_header' ), ) ); and that I add as this add_action( 'genesis_after_header', function() { genesis_widget_area ('my_header', array( 'before' => '<div class="my_header"><div class="my_wrap">', 'after' => '</div></div>', ) ); } ); Then, the user adds 3 text widgets inside the widget area, the question is how can I get the content of …
Category: Web

Help With Custom Image and Text Widget

I recently got into making a custom WordPress theme and I've learned a lot along the way, but I've hit a roadblock with making a custom widget.This is the basic output HTML I'd like my widget to output: <div class="work-column"> <img src="images/hero.jpg" class="ui image"> <div class="info"> <p>Rihana <span>Digital</span></p> </div> <a href="project.html"></a> </div> So it looks like this: I got some of it down I got the basics of the widget form in the back-end, by looking into a quite a …
Category: Web

Custom CSS for a particular text/html widget in Wordpress

I have a couple of text widgets on my Home Sidebar. There is one text widget in particular that I want it to implement custom CSS written in my child theme rather than the default styling provided by the theme. Is that possible? If yes, how? Edit: the below answer generally doesn't work because most widgets have their css implemented after both, the theme style and the custom style file.
Category: Web

Widget back end radio button issue

I am using such kind of arrangements in my widget.php → <p> <input class="radio" type="radio" <?php checked( $instance[ 'the_style_1' ], 'on' ); ?> id="<?php echo $this->get_field_id( 'the_style_1' ); ?>" name="<?php echo $this->get_field_name( 'the_style_1' ); ?>" /> <label for="<?php echo $this->get_field_id( 'the_style_1' ); ?>">This will display the snippet style 1</label> </p> <p> <input class="radio" type="radio" <?php checked( $instance[ 'the_style_2' ], 'on' ); ?> id="<?php echo $this->get_field_id( 'the_style_2' ); ?>" name="<?php echo $this->get_field_name( 'the_style_2' ); ?>" /> <label for="<?php echo $this->get_field_id( 'the_style_2' …
Category: Web

Input with pattern not working

On the admin widgets.php page I am trying to setup a pattern on an input to only allow digits. If I enter an invalid character like a non-digit it still accepts it and when I save the Widget with an invalid character in the input it also accepts it. Here is the pattern I am using: required pattern="[0-9]{3}" Here is the input markup: <input type="text" value="200" maxlength="3" required="" pattern="[0-9]{3}" title="Three or less digit numbers only" class="widefat" id="widget_categories_v2-4-menu_width" name="widget_categories_v2[4][menu_width]"> Not sure …
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.