Advertisement
Apina

SmartMag Slider CPT

Dec 29th, 2014
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. /*
  2. These two functions will allow the SmartMag theme to see a custom post type in the slider and
  3. also add the Post Options to the CPT (otherwise you can't add the cpt to be a featured slider).
  4. */
  5.  
  6. //allow CPT in slider
  7. function bgm_swap_slider_to_games_cpt($args) {
  8.  
  9. $args['post_type'] = array( 'post', 'games');
  10.  
  11. return $args;
  12.  
  13. }
  14. add_filter('bunyad_block_query_args','bgm_swap_slider_to_games_cpt');
  15.  
  16.  
  17.  
  18. //give the CPT the Post Options options.
  19. function bgm_make_theme_see_cpt( $args ) {
  20.  
  21. $args['meta_boxes'] = array(
  22. array('id' => 'post-options', 'title' => __('Post Options', 'bunyad'), 'priority' => 'high', 'page' => array('post', 'games')),
  23. array('id' => 'post-reviews', 'title' => __('Review', 'bunyad'), 'priority' => 'high', 'page' => array('post')),
  24. array('id' => 'page-options', 'title' => __('Page Options', 'bunyad'), 'priority' => 'high', 'page' => array('page')),
  25. );
  26.  
  27. return $args;
  28. }
  29. add_filter('bunyad_init_config','bgm_make_theme_see_cpt');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement