Advertisement
Guest User

Untitled

a guest
May 25th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. root@wordpress:/var/lib/wordpress/wp-content/themes/twentyseventeen-child# cat functions.php
  2.  
  3.  
  4. <?php
  5. function my_theme_enqueue_styles() {
  6.  
  7. $parent_style = 'twentyseventeen-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme.
  8.  
  9. wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
  10. wp_enqueue_style( 'child-style',
  11. get_stylesheet_directory_uri() . '/style.css',
  12. array( $parent_style ),
  13. wp_get_theme()->get('Version')
  14. );
  15. }
  16.  
  17.  
  18. // Create Custom Post Type for Work
  19. function create_post_type() {
  20. register_post_type( 'farmer',
  21. array(
  22. 'thumbnail',
  23. 'labels' => array(
  24. 'name' => __( 'Custom' ),
  25. 'singular_name' => __( 'Custom' )
  26. ),
  27. 'public' => true,
  28. 'has_archive' => true,
  29. 'rewrite' => array('slug' => 'custom'),
  30. 'taxonomies' => array('category', 'post_tag'),
  31. 'supports' => array( 'thumbnail' )
  32. )
  33. );
  34. }
  35. add_action( 'init', 'create_post_type' );
  36.  
  37. add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
  38. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement