how to override woocommerce specific loop or archive-product.php [closed]

The WooCommerce templating works in different ways depending on your needs and/or skills. The function: <?php wc_get_template_part(‘content’, ‘product’); is the WooCommerce equivalent of WordPress core template function: <?php get_template_part(‘filename’); It is important to know that this is the same as php require but without using .php extension at the end. Before you do any of … Read more

How to force one column layout on custom post type edit page?

There is a filter called get_user_option_meta-box-order_{$page} where $page is the name of the post type. Just make sure that submitdiv is the last value in the array: add_filter( ‘get_user_option_meta-box-order_post’, ‘wpse25793_one_column_for_all’ ); function wpse25793_one_column_for_all( $order ) { return array( ‘normal’ => join( “,”, array( ‘postexcerpt’, ‘formatdiv’, ‘trackbacksdiv’, ‘tagsdiv-post_tag’, ‘categorydiv’, ‘postimagediv’, ‘postcustom’, ‘commentstatusdiv’, ‘slugdiv’, ‘authordiv’, ‘submitdiv’, ) … Read more

add button to post edit page when post_status=publish

This will get you started; add_action( ‘post_submitbox_misc_actions’, ‘custom_button’ ); function custom_button(){ $html=”<div id=”major-publishing-actions” style=”overflow:hidden”>”; $html .= ‘<div id=”publishing-action”>’; $html .= ‘<input type=”submit” accesskey=”p” tabindex=”5″ value=”Customize Me!” class=”button-primary” id=”custom” name=”publish”>’; $html .= ‘</div>’; $html .= ‘</div>’; echo $html; } Adds a custom button to Publish Meta Box – example; So far you still need to; register … Read more

How to disable page delete

You can remove the capabilites delete_pages, delete_others_pages and delete_published_pages from the role which the user is assigned to. This will prevent the complete user role from deleting pages. To restrict this behavior only to one user, you have to create and assign a dedicated, new role to the user. Look at the Members plugin from … Read more

Prevent pre_get_posts filter on specific post type

Improve your conditional to include a check for post type being queried. It can be done via WP_Query::get method So, where you have if ( !is_admin() ){ $query->set( ‘meta_key’, ‘_ct_selectbox_52f65ae267764’ ); $query->set( ‘meta_value’, $city ); return; } replace with if ( ! is_admin() && in_array ( $query->get(‘post_type’), array(‘event’,’venue’) ) ) { $query->set( ‘meta_key’, ‘_ct_selectbox_52f65ae267764’ ); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)