Skip to content

Instantly share code, notes, and snippets.

Avatar

Yan Knudtskov yanknudtskov

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

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 Jan 4, 2014
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…
View remove-admin-pages.php
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' );
}
View Disable Post Revisions in Wordpress.php
define('WP_POST_REVISIONS', false);
@yanknudtskov
yanknudtskov / set-post-revisions.php
Created Jan 4, 2014
Set the number of post revisions to keep in Wordpress
View set-post-revisions.php
define('WP_POST_REVISIONS', 10);
@yanknudtskov
yanknudtskov / define-akismet-key-for-multi-site.php
Created Jan 4, 2014
Set Akismet Key Once for a multisite network.
View define-akismet-key-for-multi-site.php
define('WPCOM_API_KEY','your-key');
@yanknudtskov
yanknudtskov / disallow-file-mods.php
Created Jan 4, 2014
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.
View disallow-file-mods.php
define('DISALLOW_FILE_MODS', true);
@yanknudtskov
yanknudtskov / disable-theme-and-plugin-editors.php
Created Jan 4, 2014
Disable the Theme and Plugin editors
View disable-theme-and-plugin-editors.php
define('DISALLOW_FILE_EDIT', true);
@yanknudtskov
yanknudtskov / rename-mu-plugins-folder.php
Created Jan 4, 2014
Rename Must Use Plugins Folder In this case it's set relative to the plugins folder.
View rename-mu-plugins-folder.php
define( 'WPMU_PLUGIN_URL', WP_CONTENT_URL . '/new-name' );
@yanknudtskov
yanknudtskov / change-mu-plugins-folder.php
Created Jan 4, 2014
Change location the Wordpress Must Use Plugin Folder (mu-plugins)
View change-mu-plugins-folder.php
define( 'WPMU_PLUGIN_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/path/to/mu-plugins' );
@yanknudtskov
yanknudtskov / move-plugins-folder.php
Created Jan 4, 2014
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…
View move-plugins-folder.php
define( 'WP_PLUGIN_DIR', dirname(__FILE__) . '/path/to/plugins' );
define( 'WP_PLUGIN_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/path/to/plugins' );
You can’t perform that action at this time.