disable meta on post except date

March 2014 WordPress Theme
GK User
Sat Jun 28, 2014 9:39 pm
how to disable the view of the post meta except post date?

or how to put this below the post?


meta1.png
User avatar
Senior Boarder

GK User
Mon Jun 30, 2014 8:07 am
Hi,

On each post, you have "post additional params" metabox (above the featued image), here you can disable all elements except date, title and featured image).

You can also use global option from Template Options -> Basic tab -> "Post sidebar informations" which disable all elements on all posts.
User avatar
Moderator

GK User
Wed Oct 22, 2014 11:33 am
Hello,

I have the reverse problem, Trying to get the metabox and param to show in the first place!!

It works fine on regular posts and pages but .......

Regarding this meta box, I just cant get it to display on the single posts - on custom post types. I thought I had found all the relevant code lines but still no display.

Could you do a check list I can quickly run through to make sure I have it all.

R
User avatar
Fresh Boarder

GK User
Wed Oct 22, 2014 12:11 pm
Hello,

please check gavern/helpers/helpers.layout.features.php file and add_gavern_metaboxes function.
here you should duplicate this fragment:

Code: Select all
add_meta_box( 'gavern-post-params', __('Post additional params', GKTPLNAME), 'gavern_post_params_callback', 'post', 'side', 'default' );


with your custom post name.
User avatar
Moderator

GK User
Wed Oct 22, 2014 12:12 pm
Hi,

Had already done, - anything else?
User avatar
Fresh Boarder

GK User
Wed Oct 22, 2014 12:17 pm
You've added this fragment and can't see this metabox? Because I've tested it with product custom post type and metabox is visible - of course not work properly, because of the product structure, but metabox and options are displayed properly.
User avatar
Moderator

GK User
Wed Oct 22, 2014 12:21 pm
// post title
add_meta_box( 'gavern-post-params', __('Post additional params', GKTPLNAME), 'gavern_post_params_callback', 'post', 'side', 'default' );
add_meta_box( 'gavern-post-params', __('Post additional params', GKTPLNAME), 'gavern_post_params_callback', 'review', 'side', 'default' );
add_meta_box( 'gavern-post-params', __('Post additional params', GKTPLNAME), 'gavern_post_params_callback', 'latest_news', 'side', 'default' );
add_meta_box( 'gavern-post-params', __('Page additional params', GKTPLNAME), 'gavern_post_params_callback', 'page', 'side', 'default' );


}


It does not display on 'review' or 'latest_news' although it does work on posts and pages.
User avatar
Fresh Boarder

GK User
Wed Oct 22, 2014 12:36 pm
Note the theme in question is Game and not News 2, sorry - found the original post through search.

As mentioned I can see the boxes in the admin side. What concerns me is displaying the stored meta data on the custom posts. ie not visible.

What else could be causing the problem?
User avatar
Fresh Boarder

GK User
Wed Oct 22, 2014 12:58 pm
Could it be something with the fact im using multisite, or could it be the how the post types were registered ?

You say you tested - how? Multisite?
User avatar
Fresh Boarder

GK User
Thu Oct 23, 2014 9:37 am
No I didn't test it on multisite installation, but I think that's not a source of the problem.
Are you sure that the cusotm post name 'latest_news' is correct? and please notice that if that custom post type uses another structure these options even if they will be visible - the won't work properly.
User avatar
Moderator

GK User
Thu Oct 23, 2014 1:59 pm
Hi Again,

Yes custom post type is latest_news
User avatar
Fresh Boarder

GK User
Thu Oct 23, 2014 2:03 pm
register_post_type('review', array(
'label' => 'Reviews',
'description' => '',
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'capability_type' => 'post',
'map_meta_cap' => true,
'hierarchical' => true,
'rewrite' => array('slug' => 'review', 'with_front' => true),
'query_var' => true,
'supports' => array('title','editor','excerpt','trackbacks','custom-fields','comments','revisions','thumbnail','author','post-formats'),
'labels' => array (
'name' => 'Reviews',
'singular_name' => 'Review',
'menu_name' => 'Reviews',
'add_new' => 'Add Review',
'add_new_item' => 'Add New Review',
'edit' => 'Edit',
'edit_item' => 'Edit Review',
'new_item' => 'New Review',
'view' => 'View Review',
'view_item' => 'View Review',
'search_items' => 'Search Reviews',
'not_found' => 'No Reviews Found',
'not_found_in_trash' => 'No Reviews Found in Trash',
'parent' => 'Parent Review',
)
) ); }
add_action('init', 'cptui_register_my_cpt_latest_news');
function cptui_register_my_cpt_latest_news() {
register_post_type('latest_news', array(
'label' => 'Latest News',
'description' => '',
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'capability_type' => 'post',
'map_meta_cap' => true,
'hierarchical' => true,
'rewrite' => array('slug' => 'Latest-News', 'with_front' => 1),
'query_var' => true,
'has_archive' => true,
'supports' => array('title','editor','excerpt','trackbacks','custom-fields','comments','revisions','thumbnail','author','post-formats'),
'labels' => array (
'name' => 'Latest News',
'singular_name' => 'News Item',
'menu_name' => 'Latest News',
'add_new' => 'Add News Item',
'add_new_item' => 'Add New News Item',
'edit' => 'Edit',
'edit_item' => 'Edit News Item',
'new_item' => 'New News Item',
'view' => 'View News Item',
'view_item' => 'View News Item',
'search_items' => 'Search Latest News',
'not_found' => 'No Latest News Found',
'not_found_in_trash' => 'No Latest News Found in Trash',
'parent' => 'Parent News Item',
)
) ); }

add_action('init', 'cptui_register_my_taxes_review_types');
function cptui_register_my_taxes_review_types() {
register_taxonomy( 'review_types',array (
0 => 'review',
),
array( 'hierarchical' => true,
'label' => 'Review Types',
'show_ui' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'gambling-reviews' ),
'show_admin_column' => false,
'labels' => array (
'search_items' => 'Review Type',
'popular_items' => '',
'all_items' => '',
'parent_item' => '',
'parent_item_colon' => '',
'edit_item' => '',
'update_item' => '',
'add_new_item' => '',
'new_item_name' => '',
'separate_items_with_commas' => '',
'add_or_remove_items' => '',
'choose_from_most_used' => '',
)
) );
}
add_action('init', 'cptui_register_my_taxes_news_type');
function cptui_register_my_taxes_news_type() {
register_taxonomy( 'news-type',array (
0 => 'latest_news',
),
array( 'hierarchical' => true,
'label' => 'News Types',
'show_ui' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'news' ),
'show_admin_column' => false,
'labels' => array (
'search_items' => 'News Article',
'popular_items' => '',
'all_items' => '',
'parent_item' => '',
'parent_item_colon' => '',
'edit_item' => '',
'update_item' => '',
'add_new_item' => '',
'new_item_name' => '',
'separate_items_with_commas' => '',
'add_or_remove_items' => '',
'choose_from_most_used' => '',
User avatar
Fresh Boarder

GK User
Thu Oct 23, 2014 2:40 pm
I've added this function:
Code: Select all
function cptui_register_my_cpt_review() {
    $args = array(
       'label' => 'Reviews',
      'description' => '',
      'public' => true,
      'show_ui' => true,
      'show_in_menu' => true,
      'capability_type' => 'post',
      'map_meta_cap' => true,
      'hierarchical' => true,
      'rewrite' => array('slug' => 'review', 'with_front' => true),
      'query_var' => true,
      'supports' => array('title','editor','excerpt','trackbacks','custom-fields','comments','revisions','thumbnail','author','post-formats'),
      'labels' => array (
      'name' => 'Reviews',
      'singular_name' => 'Review',
      'menu_name' => 'Reviews',
      'add_new' => 'Add Review',
      'add_new_item' => 'Add New Review',
      'edit' => 'Edit',
      'edit_item' => 'Edit Review',
      'new_item' => 'New Review',
      'view' => 'View Review',
      'view_item' => 'View Review',
      'search_items' => 'Search Reviews',
      'not_found' => 'No Reviews Found',
      'not_found_in_trash' => 'No Reviews Found in Trash',
      'parent' => 'Parent Review'
    ) );
    register_post_type( 'review', $args );
}

add_action('init', 'cptui_register_my_cpt_review');

and this line into helpers.features.php file:
Code: Select all
add_meta_box( 'gavern-post-params', __('Post additional params', GKTPLNAME), 'gavern_post_params_callback', 'post', 'side', 'default' );

and metabox is visible when I'm adding new reviews.
User avatar
Moderator

GK User
Tue Oct 28, 2014 9:14 am
The meta box is added to the admin adding reviews section but the settings do not save nor does the display box appear on the front end of the review. The display problem is probably a symptom of the saving issue.
User avatar
Fresh Boarder


cron