Skip to content

Instantly share code, notes, and snippets.

@wiserweb
Forked from thecodepoetry/functions.php
Created May 2, 2017 20:57
Show Gist options
  • Save wiserweb/8fa20d94461e9f1257f8ab844e1e08d0 to your computer and use it in GitHub Desktop.
Save wiserweb/8fa20d94461e9f1257f8ab844e1e08d0 to your computer and use it in GitHub Desktop.
Change sidebar position for woocommerce products for The7 -Mulltipurpose wordpress them
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