-
-
Save saltyfireball/6f6c12b31b795e49fdffc258867bb145 to your computer and use it in GitHub Desktop.
Change sidebar position for woocommerce products for The7 -Mulltipurpose wordpress them
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function change_sidebar_pos() { | |
| $args = array ( | |
| 'post_type' => 'product', | |
| 'post_per_page' => -1 | |
| ); | |
| query_posts( $args ); | |
| while ( have_posts() ) : the_post(); | |
| update_post_meta( get_the_ID(), '_dt_sidebar_position', 'left' ); | |
| endwhile; | |
| } | |
| add_action('admin_init', 'change_sidebar_pos'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment