Any post install tips after installing WordPress 3.0.1?

01 Database Security 01.01 change your database prefix during install or after install this is security by obscurity but helps with automated scripts that could run over all databases to inject bad code in your content like scripts, iframes or display: bits 01.02 install a database backup plugin to automate the backup e.g. http://wordpress.org/extend/plugins/wp-db-backup/ Read … Read more

Rename UPLOADS folder with custom WP_CONTENT_DIR

After digging around, I ended up with using upload_dir filter. Here is what I tried in functions.php to change uploads to media. Hope it can help someone too 🙂 add_filter(‘upload_dir’, function($uploads) { $custom = []; foreach ($uploads as $key => $value) { if ( false !== strpos($value, ‘/app/uploads’) ) { $custom[$key] = str_replace(‘/app/uploads’, ‘/app/media’, $value); … Read more

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

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

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