This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function dwwp_register_post_type() { | |
$args = array('public'=> true, 'label'=> 'Staff'); | |
register_post_type( 'staff', $args); | |
} | |
add_action( 'init', 'dwwp_register_post_type' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Enqueue scripts and styles | |
*/ | |
function your_theme_enqueue_scripts() { | |
// all styles | |
wp_enqueue_style( 'bootstrap', get_stylesheet_directory_uri() . '/css/bootstrap.css', array(), 20141119 ); | |
wp_enqueue_style( 'theme-style', get_stylesheet_directory_uri() . '/css/style.css', array(), 20141119 ); | |
// all scripts | |
wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '20120206', true ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function dwwp_add_google_link() { | |
global $wp_admin_bar; | |
$wp_admin_bar->add_menu( array( | |
'id' => 'google_analytics', | |
'title' => 'Google Analytics', | |
'href' => 'http://google.com/analytics/' | |
) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Exit if accessed directly | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} | |
function dwwp_register_post_type() { | |
$singular = 'Job'; | |
$plural = 'Jobs'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Define our Custom Post Type | |
function dwwp_register_post_type() { | |
//Add a filter to our $singular variable. | |
$singular = apply_filters( 'dwwp_label_single', 'Book' ); | |
//Add a filter to our $plural variable. | |
$plural = apply_filters( 'dwwp_label_plural', 'Books' ); | |
$labels = array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function dwwp_remove_dashboard_widgets() { | |
remove_meta_box( 'dashboard_primary', 'dashboard', 'post_container_1' ); | |
} | |
add_action( 'wp_dashboard_setup', 'dwwp_remove_dashboard_widgets' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function dwwp_register_taxonomy() { | |
$singular = 'Location'; | |
$plural = 'Locations'; | |
$slug = str_replace( ' ', '_', strtolower( $singular ) ); | |
$labels = array( | |
'name' => $plural, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once ( plugin_dir_path(__FILE__) . 'wp-job-cpt.php' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function dwwp_add_custom_meta() { | |
add_meta_box( | |
'dwwp_meta', | |
'Job Listing', | |
'dwwp_meta_callback', | |
'job', | |
'side', | |
'core' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//If you only need to change one use this version. | |
function dwwp_change_title( $title_placeholder) { | |
$screen = get_current_screen(); | |
if ( $screen->post_type == 'job' ) { //<--Your post type name goes here. | |
$title_placeholder = 'I changed the title yo'; | |
OlderNewer