This file contains hidden or 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
| attachment_url_to_postid() |
This file contains hidden or 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
| add_theme_support( 'myplugin-testimonials' ); // functions.php | |
| if ( function_exists('myplugin_testimonial_html') ) { myplugin_testimonial_html(); } // template file | |
| // Order by MENU ORDER > ASC when displayed in an archive. | |
| function rc_modify_query_get_design_projects( $query ) { | |
| if ( ! is_admin() && $query->is_main_query() && is_post_type_archive( 'testimonial' ) ) { | |
| $query->set('orderby', 'menu_order' ); |
This file contains hidden or 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
| // Remove default columns from manage view. | |
| function myplugin_custom_manage_testimonial_columns( $columns ) { | |
| unset( $columns['author'] ); | |
| unset( $columns['date'] ); | |
| $columns['description'] = __( 'Excerpt' ); | |
| //$columns['menu_order_testimonial'] = __( 'Order' ); | |
| return $columns; | |
| } | |
| add_filter( 'manage_edit-testimonial_columns', 'myplugin_custom_manage_testimonial_columns' ); |
This file contains hidden or 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
| // Register 'Testimonial' Custom Post Type | |
| function myplugin_testimonial_post_type() { | |
| $labels = array( | |
| 'name' => _x( 'Testimonials', 'Post Type General Name' ), | |
| 'singular_name' => _x( 'Testimonial', 'Post Type Singular Name' ), | |
| 'menu_name' => __( 'Testimonials' ), | |
| 'add_new_item' => __( 'Add New Testimonial' ), | |
| 'search_items' => __( 'Search Testimonials' ), | |
| ); |
This file contains hidden or 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 get_header(); ?> | |
| <?php if ( have_posts() ) : ?> | |
| <div class="container none-page-content testimonials"> | |
| <h1><?php post_type_archive_title(); ?></h1> | |
| <?php while ( have_posts() ) : the_post(); ?> | |
| <blockquote> |
This file contains hidden or 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 get_header(); ?> | |
| <?php if ( have_posts() ) : ?> | |
| <div class="container none-page-content testimonials"> | |
| <h1 class="capitalize"><?php echo get_post_type(); ?></h1> | |
| <?php while ( have_posts() ) : the_post(); ?> | |
| <blockquote> |
This file contains hidden or 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
| if ( current_theme_supports( 'onehundred-call-to-action' ) ) { | |
| function myplugin_call_to_action_customize_register($wp_customize) { | |
| $wp_customize->add_section('call_to_action', array( | |
| 'title' => __('Call to Action Button', 'onehundred'), | |
| 'priority' => 25, | |
| ) ); | |
| $wp_customize->add_setting('myplugin_call_to_action_text', array( |
This file contains hidden or 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
| $columns['menu_order'] = __( 'Order' ); | |
| case 'menu_order': | |
| $order = $post->menu_order; | |
| $ancestors = array_reverse( get_post_ancestors( $post->ID ) ); | |
| $value = get_post_meta( $post->ID, '_myplugin_include_in_menu', true ); |
This file contains hidden or 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
| function myplugin_custom_manage_affiliation_columns( $columns ) { | |
| unset( $columns['author'] ); | |
| unset( $columns['date'] ); | |
| $columns['menu_order_affiliation'] = __( 'Order' ); | |
| return $columns; | |
| } | |
| add_filter( 'manage_edit-affiliation_columns', 'myplugin_custom_manage_affiliation_columns' ); |
This file contains hidden or 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
| function myplugin_include_in_menu_meta_box() { | |
| // Assign the ID of the page we're attempting to edit to a variable. | |
| if ( isset( $_GET['post'] ) ) { $post_id = $_GET['post']; } | |
| elseif ( isset( $_POST['post_ID'] ) ) { $post_id = $_POST['post_ID']; } | |
| // Display metabox if we're creating a new page or editing a page other than the Homepage. | |
| $front_page = get_option('page_on_front'); | |
| if ( ! isset($post_id) || ($post_id != $front_page) ) { | |
| add_meta_box( 'myplugin_include_in_menu', __( 'Include in Navigation' ), 'myplugin_include_in_menu_meta_box_callback', 'page', 'side', 'default' ); | |
| } |