Wordpress

10 Most Used Web Development Tools

Strong Password Generator strongpasswordgenerator.com Advanced CSS topics alistapart.com Rounded Corners border-radius.com Image Placeholders placehold.it Favicon Generators www.favicon.cc Gradient Generator www.colorzilla.com/gradient-editor Color Picker www.colorpicker.com Color themes kuler.adobe.com/create/color-wheel Free icons raphaeljs.com/icons CSS Shadows www.cssmatic.com/box-shadow

WordPress misses Publishing Schedule

I haven’t figured out why WordPress is missing schedule post, but I wrote a script that is ran with crontab that notifies me when it happens. <?php include 'wp-load.php'; $total_missed_schedules = 0; $blogs = crontab_get_blogs(); $output = ''; foreach($blogs as $blog) { $blog_prefix = $wpdb->get_blog_prefix( $blog->blog_id ); $results = query_missed_schedules(…

How to Add CSS Styles to WordPress Breadcrumbs

functions.php function get_page_parents( $id=0, $separator="/" ){ $itisme=get_post($id); $lineage = '<span>'.$itisme->post_title.'</span>'; $parentID=$itisme->post_parent; while( $parentID != 0 ){ $parent=get_post($parentID); $lineage='<a href="' . get_permalink($parent->ID) . '">' . $parent->post_title . '</a>'.$separator.$lineage; $parentID=$parent->post_parent; } return $lineage; } include 'includes/breadcrumb-styles.php'; add_action('wp_head', 'add_breadcrumb_styles'); page.php <?php get_template_part( 'nav', 'above-page' ); ?> nav-above-page.php <div id="page-bread-crumbs"> <a class="home" href="/">Home</a> &gt;…

Custom Post Type redirects to 404 page

This function from dev4press really helped me debug my custom post type redirect to a 404 page.   Place this code in your functions.php file: function dev4press_debug_page_request() { global $wp, $template; echo '<pre>!– Request: '; echo empty($wp->request) ? "None" : esc_html($wp->request); echo ' –>'.PHP_EOL; echo '!– Matched Rewrite Rule: ';…

Custom post type capabilities

$custom_posts_caps = array('edit_custom_post', 'read_custom_post', 'delete_custom_post', 'edit_custom_posts', 'edit_others_custom_posts', 'publish_custom_posts', 'read_private_custom_posts'); _smg_add_cap('administrator', $custom_posts_caps); _smg_add_cap('editor', $custom_posts_caps); 'capabilities' => array( 'edit_post' => 'edit_custom_post', 'read_post' => 'read_custom_post', 'delete_post' => 'delete_custom_post', 'edit_posts' => 'edit_custom_posts', 'edit_others_posts' => 'edit_others_custom_posts', 'publish_posts' => 'publish_custom_posts', 'read_private_posts' => 'read_private_custom_posts' ),

Create and verify a nonce

All of this is created in a class // place this in __construct of the class $this->nonce_name = 'name_' . $my_post_type_slug; $this->nonce_action = 'saving_posttype_' . $my_post_type_slug; add_action('save_post', 'save_my_custom_posttype', 10); // place this in a meta box echo ' '; // your custom save w/ nonce function save_my_custom_posttype($post_id) { if (isset($_POST[…

Skip to toolbar