Title: hussein87's Replies | WordPress.org

---

# hussein87

  [  ](https://wordpress.org/support/users/hussein87/)

 *   [Profile](https://wordpress.org/support/users/hussein87/)
 *   [Topics Started](https://wordpress.org/support/users/hussein87/topics/)
 *   [Replies Created](https://wordpress.org/support/users/hussein87/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/hussein87/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/hussein87/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/hussein87/engagements/)
 *   [Favorites](https://wordpress.org/support/users/hussein87/favorites/)

 Search replies:

## Forum Replies Created

Viewing 10 replies - 1 through 10 (of 10 total)

 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[Twenty Twenty-Three] Create a default content in the single template which can be update it once](https://wordpress.org/support/topic/create-a-default-content-in-the-single-template-which-can-be-update-it-once/)
 *  Thread Starter [hussein87](https://wordpress.org/support/users/hussein87/)
 * (@hussein87)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/create-a-default-content-in-the-single-template-which-can-be-update-it-once/#post-16829608)
 * Hi [@mrfoxtalbot](https://wordpress.org/support/users/mrfoxtalbot/)! Thank you
   for your answer and sorry for my late response.
 * I appreciate your helpful answer, but I was actually aiming for a slightly different
   solution. I wanted to find a method that would allow for updates to the blocks
   in the future, as needed. The approach you suggested converts the reusable block
   into a regular one, which means it won’t receive any updates made to the original
   reusable block.
 * I ended up creating a template part and utilized ACF along with shortcodes to
   display the values of each individual post’s fields, then used the template part
   in the single post’s template.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Only if multi options, change variations from dropdown to radio buttons](https://wordpress.org/support/topic/only-if-multi-options-change-variations-from-dropdown-to-radio-buttons/)
 *  Thread Starter [hussein87](https://wordpress.org/support/users/hussein87/)
 * (@hussein87)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/only-if-multi-options-change-variations-from-dropdown-to-radio-buttons/#post-16147369)
 * Just in case someone wanted to achieve what I was trying to do, here’s how I 
   solved this:
 * **FIRST:** I used JavaScript to loop through attributes and check if `Select`
   has more than 1 option and add a class to it.
 *     ```
       let checkSelects = [...document.querySelectorAll(".value select")]
   
       checkSelects.forEach(checkSelect => {
         if (checkSelect.length > 2) {
           checkSelect.classList.add("active")
         }
       })
       ```
   
 * **SECOND: ** I applied the CSS code to the added class like this:
 *     ```
       .value select.active{
       	display: inline-block !important;
       }
       ```
   
 * Now the default Woocommerce dropdown menu is displayed again but we need to the
   generated radio buttons like this:
 *     ```
       .value label:not(:only-of-type){
       		display: none !important;
       }
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Only if multi options, change variations from dropdown to radio buttons](https://wordpress.org/support/topic/only-if-multi-options-change-variations-from-dropdown-to-radio-buttons/)
 *  Thread Starter [hussein87](https://wordpress.org/support/users/hussein87/)
 * (@hussein87)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/only-if-multi-options-change-variations-from-dropdown-to-radio-buttons/#post-16139685)
 * Hi [@daniyalahmedk](https://wordpress.org/support/users/daniyalahmedk/)
 * Thanks for the reply!
 * I understand that, and since the code above is doing the job, I just need to 
   find a way to loop through the attributes and apply the JS code to those, who
   have more than one option.
 * All the best,
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Only if multi options, change variations from dropdown to radio buttons](https://wordpress.org/support/topic/only-if-multi-options-change-variations-from-dropdown-to-radio-buttons/)
 *  Thread Starter [hussein87](https://wordpress.org/support/users/hussein87/)
 * (@hussein87)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/only-if-multi-options-change-variations-from-dropdown-to-radio-buttons/#post-16138016)
 * Hi, thanks for your reply!
 * **The code above works perfectly for me and change the dropdown menu to a radio
   button. **
 * I was asking, how to make this change only for variations that have only one 
   option (which is selected by default in Woo backend). So if there are multioptions
   in the variation I want to keep the dropdown menu.
 * Here’s an image for clarification:
    [https://snipboard.io/ur8WoG.jpg](https://snipboard.io/ur8WoG.jpg)
 * I appreciate any help!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] Add an UM Action under Users](https://wordpress.org/support/topic/add-an-um-action-under-users/)
 *  Thread Starter [hussein87](https://wordpress.org/support/users/hussein87/)
 * (@hussein87)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/add-an-um-action-under-users/#post-15737429)
 * Hi, that works perfectly, I just changed ‘approved_email’ > ‘welcome_email’ as
   i wanted to resend that template.
 * Thank you so much guys for the fast replays and amazing support.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] Add an UM Action under Users](https://wordpress.org/support/topic/add-an-um-action-under-users/)
 *  Thread Starter [hussein87](https://wordpress.org/support/users/hussein87/)
 * (@hussein87)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/add-an-um-action-under-users/#post-15735558)
 * Hi [@aswingiri](https://wordpress.org/support/users/aswingiri/)
 * Thank you so much for your quick answer and for providing the code snippets.
 * The action has been added to the UM action options list.
 * However, because of my weak PHP skills, I’m not able to replace custom_action_key
   and link the UM welcome_email template to the added action.
 * What else should I update?
 * I understand custom code is not supported, but I really appreciate your help!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Connect Polylang for Elementor] Elementor translated templates not showing the in dynamic content](https://wordpress.org/support/topic/elementor-translated-templates-not-showing-the-in-dynamic-content/)
 *  Thread Starter [hussein87](https://wordpress.org/support/users/hussein87/)
 * (@hussein87)
 * [4 years ago](https://wordpress.org/support/topic/elementor-translated-templates-not-showing-the-in-dynamic-content/#post-15644964)
 * I also noticed differences in the server configuration:
 * **Working server: **
    Software: LiteSpeed MySQL version: MySQL Community Server–
   GPL v8.0.28 PHP Version: 7.4.29
 * **Not working server: **
    Software: nginx/1.18.0 MySQL version: mariadb.org binary
   distribution v10.5.15 PHP Version: 7.4.29
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Show Posts] Multiple post types in one post list](https://wordpress.org/support/topic/multiple-post-types-in-one-post-list/)
 *  Thread Starter [hussein87](https://wordpress.org/support/users/hussein87/)
 * (@hussein87)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/multiple-post-types-in-one-post-list/#post-15190509)
 * Worked like a charm! 😀
    Yes, each one has its own taxonomy.
 * Thanks again for your help.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Show Posts] Multiple post types in one post list](https://wordpress.org/support/topic/multiple-post-types-in-one-post-list/)
 *  Thread Starter [hussein87](https://wordpress.org/support/users/hussein87/)
 * (@hussein87)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/multiple-post-types-in-one-post-list/#post-15189749)
 * Yes, that was the issue 😀
    Thank you so much for your help!
 * Can I ask one last question please,
    I’m trying to add tow custom post type with
   specific categories from different post types, but it shows only posts from the
   first category which is “current-affairs” and doesn’t show the other post type
   category events.
 * here’s the code I’m adding
 *     ```
       add_filter( 'wp_show_posts_shortcode_args', function( $args, $settings ) {
           if ( 4491 === $settings['list_id'] ) {
               $args['post_type'] = array( 'post', 'tribe_events' );
           $args['tax_query'] = array(
       			'relation' => 'OR',
       			array(
       				'taxonomy' => 'category',
       				'field'    => 'slug',
       				'terms'    => array( 'current-affairs','my-events' ),
       			),
           	);
           }
       	return $args;
       },10,2);
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Show Posts] Multiple post types in one post list](https://wordpress.org/support/topic/multiple-post-types-in-one-post-list/)
 *  Thread Starter [hussein87](https://wordpress.org/support/users/hussein87/)
 * (@hussein87)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/multiple-post-types-in-one-post-list/#post-15189735)
 * Thanks for the quick replay!
 * Yes, I did and still getting the same error, it looks like this now
 *     ```
       	// Start the query
       	$query = new WP_Query( apply_filters( 'wp_show_posts_shortcode_args', $args ) );
       	$query = new WP_Query( apply_filters( 'wp_show_posts_shortcode_args', $args, $settings ) );
       ```
   
 * What could be the mistake I’m making here?

Viewing 10 replies - 1 through 10 (of 10 total)