Skip to content

Instantly share code, notes, and snippets.

View yanknudtskov's full-sized avatar

Yan Knudtskov yanknudtskov

View GitHub Profile
@yanknudtskov
yanknudtskov / css_resources.md
Created December 23, 2013 08:48 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@yanknudtskov
yanknudtskov / remove-admin-pages.php
Created January 4, 2014 13:06
How to Remove Menu Items in Admin Depending on User Role. Examples of pages in the Wordpress Admin: remove_menu_page('edit.php'); // Posts remove_menu_page('upload.php'); // Media remove_menu_page('link-manager.php'); // Links remove_menu_page('edit-comments.php'); // Comments remove_menu_page('edit.php?post_type=page'); // Pages remove_menu_pag…
add_action( 'admin_init', 'my_remove_menu_pages' );
function my_remove_menu_pages() {
global $user_ID;
if ( current_user_can( 'wpmayorauthor' ) ) {
remove_menu_page( 'edit.php?post_type=thirstylink' );
remove_menu_page( 'edit.php?post_type=wprss_feed' );
remove_menu_page( 'authorhreview' );
}
@yanknudtskov
yanknudtskov / Disable Post Revisions in Wordpress.php
Created January 4, 2014 13:09
Disable Post Revisions in Wordpress
define('WP_POST_REVISIONS', false);
@yanknudtskov
yanknudtskov / set-post-revisions.php
Created January 4, 2014 13:10
Set the number of post revisions to keep in Wordpress
define('WP_POST_REVISIONS', 10);
@yanknudtskov
yanknudtskov / define-akismet-key-for-multi-site.php
Created January 4, 2014 13:14
Set Akismet Key Once for a multisite network.
define('WPCOM_API_KEY','your-key');
@yanknudtskov
yanknudtskov / disallow-file-mods.php
Created January 4, 2014 13:15
Disallow File Mods Be careful using this, as it will disable the ability to update both core, plugins and themes in the Wordpress Admin. It's very helpful for security or locking a website into a static version.
define('DISALLOW_FILE_MODS', true);
@yanknudtskov
yanknudtskov / disable-theme-and-plugin-editors.php
Created January 4, 2014 13:16
Disable the Theme and Plugin editors
define('DISALLOW_FILE_EDIT', true);
@yanknudtskov
yanknudtskov / rename-mu-plugins-folder.php
Created January 4, 2014 13:18
Rename Must Use Plugins Folder In this case it's set relative to the plugins folder.
define( 'WPMU_PLUGIN_URL', WP_CONTENT_URL . '/new-name' );
@yanknudtskov
yanknudtskov / change-mu-plugins-folder.php
Created January 4, 2014 13:18
Change location the Wordpress Must Use Plugin Folder (mu-plugins)
define( 'WPMU_PLUGIN_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/path/to/mu-plugins' );
@yanknudtskov
yanknudtskov / move-plugins-folder.php
Created January 4, 2014 13:19
Move the WordPress Plugin Directory So far we have assumed your plugin directory will be staying inside the content directory, but it doesn’t have to. To ensure maximum compatibility with properly coded plugins, be sure to set both the WP_PLUGIN_DIR and WP_PLUGIN_URL constant. WP_PLUGIN_DIR is the path relative to wp-config’s location and WP_PLU…
define( 'WP_PLUGIN_DIR', dirname(__FILE__) . '/path/to/plugins' );
define( 'WP_PLUGIN_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/path/to/plugins' );