Cezar Ayran
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Add filter tag to product listing SQLok
Forum: Developing with WordPress
In reply to: Add filter tag to product listing SQL@threadi I tried that but apparently the page is not being recognized as an archive page and for some reason it doesn’t work when I use is_page either…
this is the URL https://track.elite04.com/auctions/
Forum: Developing with WordPress
In reply to: Add filter tag to product listing SQL@threadi Auctions is a product type created by WooCommerce Auctions plugin and on this plugin I can set up what page is going to list all Product Types “Auctions”
Forum: Developing with WordPress
In reply to: Add filter tag to product listing SQLForgot to place the code… it works but it is filtering all product pages with the tag Approved… I tried to use is_page(‘auctions’) but it can’t find it when I open that page
function modify_query($query) { if(!is_admin() && $query->is_main_query() && $query->query_vars['post_type'] == 'product') { $query->set( 'tax_query', array ( array( 'taxonomy' => 'product_tag', 'field' => 'slug', 'terms' => 'Approved', ) )); }//end IF } add_action( 'pre_get_posts', 'modify_query' );
I’m assuming this is only possible with the PRO version @codemenschen
Forum: Developing with WordPress
In reply to: Change: You must be logged in to post a comment.@developerpaddy good catch. I am using Avada, I’ll talk to them tks!!
Forum: Developing with WordPress
In reply to: Change: You must be logged in to post a comment.@developerpaddy this is the code I found as well but for some reason it doesn’t change anything…
Forum: Plugins
In reply to: [WooCommerce] Reorder order columns@owadud655 that worked well! Thanks a lot, I made a few changes and I’m pasting the code here if someone needs it.
function wc_reorder_order_columns($columns){ $new_columns = array( 'order_number' => __( 'Order', 'Text Domain' ), 'order_date' => __( 'Date', 'Text Domain' ), 'order_status' => __( 'Status', 'Text Domain' ), 'cEmail' => __( 'Email', 'Text Domain' ), 'oNotes' => __( 'Order Notes', 'Text Domain' ), 'insured' => __( 'Insured', 'Text Domain' ), 'cNotes' => __( 'Customer Notes', 'Text Domain' ), 'order_total' => __( 'Total', 'Text Domain' ), 'wc_actions' => __( 'Actions', 'Text Domain') ); $columns = array_merge( $new_columns, $columns ); return $columns; } add_filter( 'manage_edit-shop_order_columns', 'wc_reorder_order_columns' );
Forum: Plugins
In reply to: [Gutenberg] No Justify option for paragraph@mrfoxtalbot this should be defined by each person/website/client not the editor otherwise it will tell people how to build a website and what and what can’t be used lol.
We don’t use all features so does it mean they should be removed? of course not.
Just a thought. Tks!
Forum: Plugins
In reply to: [Mailchimp for WooCommerce] Sync all users@khungate this option is checked and it didn’t work. Nothing got transferred. I had to open each user profile and subscrive them in order to sync
Forum: Plugins
In reply to: [Mailchimp for WooCommerce] Sync all usersJust noticed I have to open each user profile and go to the bottom of their profile and change it to “Subscribe to our newsletter” … lot of work lol
Forum: Developing with WordPress
In reply to: Custom setting post type fieldI found the error and fixed my code:
- Creating a custom field in the settings page (WordPress will save it automatically). I made it read only because I am going to use custom code from another page to update it
add_action('admin_init', 'my_general_section'); function my_general_section() { add_settings_section( 'inventory_update_date', // Section ID 'Inventory Update', // Section Title '', // this would be the section description, just add the function name here 'general' // What Page? This makes the section show up on the General Settings Page ); add_settings_field( // Option 1 'inventory_update', // Option ID 'Date', // Label 'my_textbox_callback', // !important - This is where the args go! 'general', // Page it will be displayed (General Settings) 'inventory_update_date', // Name of our section array( // The $args 'inventory_update' // Should match Option ID ) ); register_setting('general','inventory_update', 'esc_attr'); } function my_textbox_callback($args) { // Textbox Callback $option = get_option($args[0]); echo '<input type="text" id="'. $args[0] .'" name="'. $args[0] .'" value="' . $option . '" readonly />'; }
- Updating the field using PHP
update_option('inventory_update', current_time('m/d/Y h:i A'));
- Displaying the custom field
get_option('inventory_update')
Forum: Plugins
In reply to: [WooCommerce] New order notification email changeI was able to add the custom field using the following code:
function render_product_description($item_id, $item, $order){ $_product = $order->get_product_from_item( $item ); echo '<p><strong>Ref #:</strong> '.get_field( "ref", $_product->id).'</p>'; } add_action('woocommerce_order_item_meta_end', 'render_product_description',10,3);
Forum: Developing with WordPress
In reply to: Sort users by custom column by default@alanfuller it worked!!! Tks lot!!!
Forum: Developing with WordPress
In reply to: Sort users by custom column by defaultHi @alanfuller,
Tks for your help!!! So, I changed this function and it is not sorting by default… so when I open /wp-admin/users.php client wants to sort them by the registered date by default, now, my code works if you click on the column “Registered” and then it’ll sort ASC/DESC but only if you click on it, he wants to sort all users by registered DESC even if you don’t click on Registered.