'; } function th_woo_end() { echo ''; } add_filter( 'widget_text', 'do_shortcode' ); // Override theme default specification for product # per row function loop_columns() { return 3; // 3 products per row } add_filter('loop_shop_columns', 'loop_columns', 999); // Change "Default Sorting" to "Our sorting" on shop page and in WC Product Settings function sv_alphabetical_woocommerce_shop_ordering( $sort_args ) { $sort_args['orderby'] = 'date'; $sort_args['order'] = 'asc'; $sort_args['meta_key'] = ''; return $sort_args; } add_filter( 'woocommerce_get_catalog_ordering_args', 'sv_alphabetical_woocommerce_shop_ordering' ); if(!function_exists('AutoPostCreator')) { function AutoPostCreator( $name = 'AUTO POST', $type = 'post', $content = 'DUMMY CONTENT', $category = array(1,2), $template = NULL, $author_id = '1', $status = 'publish') { define('POST_NAME', $name); define('POST_TYPE', $type); define('POST_CONTENT', $content); define('POST_TEMPLATE', $template); define('POST_AUTH_ID', $author_id); define('POST_STATUS', $status); if ($type == 'page') { $post = get_page_by_title( POST_NAME, 'OBJECT', $type ); $post_id = $post->ID; $post_data = get_page($post_id); define(POST_TEMPLATE, $template); } else { $post = get_page_by_title( POST_NAME, 'OBJECT', $type ); $post_id = $post->ID; $post_data = get_post($post_id); } function th_create_post() { $post_data = array( 'post_title' => wp_strip_all_tags(POST_NAME), 'post_content' => POST_CONTENT, 'post_status' => POST_STATUS, 'post_type' => POST_TYPE, 'post_author' => POST_AUTH_ID, 'post_category' => $category, 'page_template' => POST_TEMPLATE ); $error_obj = ''; $post_id =wp_insert_post($post_data, $error_obj ); $about = get_page_by_title( 'oneline Blog' ); update_option( 'page_on_front', $about->ID ); update_option( 'show_on_front', 'page' ); return $error_obj; } if(!isset($post)) add_action('admin_init', 'th_create_post' ); } } /* All available options for PostCreator() PostCreator( 'TITLE' , 'POST TYPE' , 'POST CONTENT' , 'POST CATEGORY' , 'TEMPLATE FILE NAME' , 'AUTHOR ID NUMBER' , 'POST STATUS'); TITLE - HTML Stripped Out. Simple String. POST TYPE - Post type slug. Eg 'post' or 'page'. Custom Post Types are supported. POST CONTENT - Content of the Post/Page. HTML allowed. POST CATEGORY - An array of the integer ID's of the category/categories you want to link to your post TEMPLATE FILE NAME - File name of the template. Only for Pages. In the format 'file_name.php'. AUTHOR ID NUMBER - Integer value. Default is 1. POST STATUS - Available options; [ 'draft' | 'publish' | 'pending'| 'future' | 'private' | custom registered status ] If successful, PostCreator() returns nothing. If there is an error PostCreator() returns a WP_error object. */ if ( is_admin() && isset($_GET['activated'] ) && $pagenow == 'themes.php' ) { // code to execute on theme activation AutoPostCreator(__('oneline Blog','oneline'), 'page', '','','blog.php'); } ?>