Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Custom functions
- */
- // Add Block Template to existing portfolio post type
- function bbp_add_portfolio_template() {
- $post_type_object = get_post_type_object( 'portfolio' );
- $post_type_object->show_in_rest = true;
- $post_type_object->rest_base = 'portfolio';
- $post_type_object->template = array(
- array( 'core/heading', array(
- 'placeholder' => 'Executive Summary',
- 'level' => '2',
- )
- ),
- array( 'core/paragraph', array(
- 'placeholder' => 'Put the problem and the results you got into about 160 characters, with keywords. Then you can use it for your meta description.',
- 'customFontSize' => '24',
- )
- ),
- array( 'core/columns',
- array(
- 'align' => 'wide',
- 'columns' => '2',
- ),
- array(
- array( 'core/column', array(), array(
- array( 'core/image', array() ),
- ) ),
- array( 'core/column', array(), array(
- array( 'core/heading', array(
- 'placeholder'=> 'Client Company Name',
- 'level' => '3',
- ) ),
- array( 'core/paragraph', array(
- 'placeholder' => 'Describe your client: industry, company size, who their customer is, what they do.',
- ) ),
- ) ),
- ) ),
- array('core/quote', array(
- ) ),
- array( 'core/heading', array(
- 'placeholder' => 'The Challenge',
- 'level' => '2',
- ) ),
- array( 'core/paragraph', array(
- 'placeholder' => 'Why did your client need your services?',
- ) ),
- array( 'core/image', array(
- 'align' => 'wide',
- ) ),
- array( 'core/heading', array(
- 'placeholder' => 'Your Solution',
- 'level' => '2',
- ) ),
- array( 'core/paragraph', array(
- 'placeholder' => 'Write two or three short paragraphs describing what you did to solve the problem.',
- ) ),
- array( 'core/image', array(
- 'align' => 'wide',
- ) ),
- array( 'core/heading', array(
- 'placeholder' => 'Results and ROI',
- 'level' => '2',
- ) ),
- array( 'core/paragraph', array(
- 'placeholder' => 'You need a keyword-rich sound bite with numbers in it, e.g. tripled revenue or cut production time in half.',
- 'customFontSize' => '20',
- 'customTextColor' => '#FF6900',
- ) ),
- array( 'core/paragraph', array(
- 'placeholder' => 'Provide more detail about how happy the client is and why. You could put another quote here instead.',
- ) ),
- array( 'core/image', array(
- 'align' => 'wide',
- ) ),
- array( 'core/paragraph', array(
- 'placeholder' => 'Write your call to action here. Give it a large font size and a color background.',
- 'customFontSize' => '28',
- 'customTextColor' => '#ffffff',
- 'customBackgroundColor' => '#313131',
- ) ),
- array( 'core/button', array(
- 'customBackgroundColor' => '#CF2E2E',
- 'customTextColor' => '#ffffff',
- 'align' => 'center',
- ) ),
- );
- }
- add_action( 'init', 'bbp_add_portfolio_template' );
- // Add REST API support for portfolio categories
- function add_portfolio_cat_to_api() {
- $mytax = get_taxonomy( 'portfolio_category' );
- $mytax->show_in_rest = true;
- }
- add_action( 'init', 'add_portfolio_cat_to_api', 30 );
- // Add REST API support for portfolio tags
- function add_portfolio_tag_to_api() {
- $mytax = get_taxonomy( 'portfolio_tag' );
- $mytax->show_in_rest = true;
- }
- add_action( 'init', 'add_portfolio_tag_to_api', 30 );
Add Comment
Please, Sign In to add comment