function product_taxonomy()
{
register_taxonomy(
'product-category',
'product',
array(
'label' => __('Categoria Product'),
'rewrite' => array('slug' => 'product-category'),
'hierarchical' => true,
'show_ui' => true,
'show_admin_column' => true,
'query_var' => true,
)
);
}
add_action('init', 'product_taxonomy');
function product_post_type()
{
// Set UI labels for Custom Post Type
$labels = array(
'name' => _x('Products', 'Post Type General Name', 'jcr'),
'singular_name' => _x('Product', 'Post Type Singular Name', 'jcr'),
'menu_name' => __('Products', 'jcr'),
'parent_item_colon' => __('Parent Product', 'jcr'),
'all_items' => __('All Products', 'jcr'),
'view_item' => __('View Product', 'jcr'),
'add_new_item' => __('Add New Product', 'jcr'),
'add_new' => __('Add New', 'jcr'),
'edit_item' => __('Edit Product', 'jcr'),
'update_item' => __('Update Product', 'jcr'),
'search_items' => __('Search Product', 'jcr'),
'not_found' => __('Not Found', 'jcr'),
'not_found_in_trash' => __('Not found in Trash', 'jcr'),
);
// Set other options for Custom Post Type
$args = array(
'label' => __('product', 'jcr'),
'description' => __('Products information', 'jcr'),
'labels' => $labels,
'supports' => array('title', 'excerpt', 'thumbnail'),
'taxonomies' => array('product-category'),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'menu_position' => 5,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => false,
'capability_type' => 'post',
'show_in_rest' => true,
);
// Registering your Custom Post Type
register_post_type('product', $args);
}
/* Hook into the 'init' action so that the function
* Containing our post type registration is not
* unnecessarily executed.
*/
add_action('init', 'product_post_type', 0);
function testimonials_post_type()
{
// Set UI labels for Custom Post Type
$labels = array(
'name' => _x('Testimonials', 'Post Type General Name', 'jcr'),
'singular_name' => _x('Testimonial', 'Post Type Singular Name', 'jcr'),
'menu_name' => __('Testimonial', 'jcr'),
'parent_item_colon' => __('Parent Testimonial', 'jcr'),
'all_items' => __('All Testimonials', 'jcr'),
'view_item' => __('View Testimonial', 'jcr'),
'add_new_item' => __('Add New Testimonial', 'jcr'),
'add_new' => __('Add New', 'jcr'),
'edit_item' => __('Edit Testimonial', 'jcr'),
'update_item' => __('Update Testimonial', 'jcr'),
'search_items' => __('Search Testimonial', 'jcr'),
'not_found' => __('Not Found', 'jcr'),
'not_found_in_trash' => __('Not found in Trash', 'jcr'),
);
// Set other options for Custom Post Type
$args = array(
'label' => __('testimonial', 'jcr'),
'description' => __('Testimonial information', 'jcr'),
'labels' => $labels,
'supports' => array('title'),
'taxonomies' => array(),
'hierarchical' => false,
'public' => false,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'menu_position' => 5,
'can_export' => false,
'has_archive' => false,
'exclude_from_search' => false,
'publicly_queryable' => false,
'capability_type' => 'post',
'show_in_rest' => false,
);
// Registering your Custom Post Type
register_post_type('testimonial', $args);
}
/* Hook into the 'init' action so that the function
* Containing our post type registration is not
* unnecessarily executed.
*/
add_action('init', 'testimonials_post_type', 0);
function vagas_post_type()
{
// Set UI labels for Custom Post Type
$labels = array(
'name' => _x('Vagas', 'Post Type General Name', 'jcr'),
'singular_name' => _x('Vaga', 'Post Type Singular Name', 'jcr'),
'menu_name' => __('Vagas', 'jcr'),
'parent_item_colon' => __('Parent Vag', 'jcr'),
'all_items' => __('All Vagas', 'jcr'),
'view_item' => __('View Vaga', 'jcr'),
'add_new_item' => __('Add New Vaga', 'jcr'),
'add_new' => __('Add New', 'jcr'),
'edit_item' => __('Edit Vaga', 'jcr'),
'update_item' => __('Update Vaga', 'jcr'),
'search_items' => __('Search Vaga', 'jcr'),
'not_found' => __('Not Found', 'jcr'),
'not_found_in_trash' => __('Not found in Trash', 'jcr'),
);
// Set other options for Custom Post Type
$args = array(
'label' => __('vaga', 'jcr'),
'description' => __('Vagas information', 'jcr'),
'labels' => $labels,
'supports' => array('title'),
'taxonomies' => array(),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'menu_position' => 6,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'post',
'show_in_rest' => true,
);
// Registering your Custom Post Type
register_post_type('vaga', $args);
}
/* Hook into the 'init' action so that the function
* Containing our post type registration is not
* unnecessarily executed.
*/
add_action('init', 'vagas_post_type', 0);
use Carbon_Fields\Container;
use Carbon_Fields\Field;
add_action('carbon_fields_register_fields', 'ptc_theme_options');
function ptc_theme_options()
{
$basic_options_container = Container::make('theme_options', __('Geral Options'))
->add_fields(array(
Field::make('header_scripts', 'jcr_header_script', __('Header Script')),
Field::make('image', 'jcr_hero_image', __('Hero Image'))
->set_type(array('image'))
->set_required(true),
Field::make('image', 'jcr_footer_image', __('Footer Image'))
->set_type(array('image')),
Field::make('text', 'jcr_footer_image_link' . crb_get_i18n_suffix(), __('Footer Image Link')),
Field::make('image', 'jcr_footer_logo', __('Footer Logo'))
->set_type(array('image')),
Field::make('footer_scripts', 'jcr_footer_script', __('Footer Script')),
));
/*
! Acabar de configuração a API do Google Maps para o FIeld MAP
*/
Container::make('theme_options', __('Contact Options'))
->set_page_parent($basic_options_container)
->add_fields(array(
Field::make('text', 'jcr_slogan' . crb_get_i18n_suffix(), __('Slogan')),
Field::make('text', 'jcr_phone' . crb_get_i18n_suffix(), __('Geral Phone')),
Field::make('text', 'jcr_email' . crb_get_i18n_suffix(), __('Geral Email')),
Field::make('text', 'jcr_youtube_link' . crb_get_i18n_suffix(), __('Youtube Link')),
Field::make('text', 'jcr_linkedin_link' . crb_get_i18n_suffix(), __('Linkedin Link')),
Field::make('complex', 'jcr_locations', 'Locations')
->set_layout('tabbed-horizontal')
->add_fields(array(
Field::make('text', 'jcr_country', 'Country'),
Field::make('map', 'jcr_address', 'Address'),
Field::make('text', 'jcr_country_email', 'Email'),
Field::make('text', 'jcr_country_phone', 'Phone'),
)),
));
Container::make('theme_options', __('Form Options'))
->set_page_parent($basic_options_container)
->add_fields(array(
Field::make('text', 'jcr_form' . crb_get_i18n_suffix(), __('Form')),
Field::make('text', 'jcr_form_title' . crb_get_i18n_suffix(), __('Título')),
Field::make('textarea', 'jcr_form_description' . crb_get_i18n_suffix(), __('Descrição')),
));
}
use Carbon_Fields\Container;
use Carbon_Fields\Field;
// *Save Template on Hidden Field
add_action('carbon_fields_post_meta_container_saved', function ($post_id) {
$template_slug = get_page_template_slug($post_id);
if ($template_slug) {
carbon_set_post_meta($post_id, 'hero_template', $template_slug);
}
});
$allPages = ['theme-templates/page-hp.php', 'theme-templates/page-products.php', 'theme-templates/page-our-story.php', 'theme-templates/page-our-clients.php', 'theme-templates/page-mission.php', 'theme-templates/page-sustainability.php', 'theme-templates/page-about-us.php', 'theme-templates/page-people.php', 'theme-templates/page-distinguish.php'];
add_action('carbon_fields_register_fields', function () {
Container::make('post_meta', 'Hero Section')
->where('post_type', '=', 'page')
->where('post_id', 'NOT IN', array(get_option('page_for_posts')))
->where('post_template', 'NOT IN', array('theme-templates/page-contact.php', 'theme-templates/page-docs.php'))
->add_fields([
Field::make('text', 'hero_subtitle', 'Subtitle'),
Field::make('text', 'hero_title', 'Titulo')
->set_attribute('maxLength', '250')
->set_conditional_logic(array(
'relation' => 'AND',
array(
'field' => 'hero_template',
'value' => array('theme-templates/page-our-story.php'),
'compare' => 'NOT IN',
)
)),
Field::make('textarea', 'hero_description', 'Descricao')
->set_attribute('maxLength', '600')
->set_conditional_logic(array(
'relation' => 'AND',
array(
'field' => 'hero_template',
'value' => array('theme-templates/page-distinguish.php', 'theme-templates/page-mission.php'),
'compare' => 'NOT IN',
)
)),
Field::make('image', 'hero_main_image', 'Imagem Principal')
->set_conditional_logic(array(
'relation' => 'AND',
array(
'field' => 'hero_template',
'value' => array('theme-templates/page-our-story.php', 'theme-templates/page-our-clients.php', 'theme-templates/page-mission.php', 'theme-templates/page-sustainability.php', 'theme-templates/page-distinguish.php'),
'compare' => 'IN',
)
)),
Field::make('image', 'hero_main_image_mobile', 'Imagem Principal Mobile')
->set_conditional_logic(array(
'relation' => 'AND',
array(
'field' => 'hero_template',
'value' => array('theme-templates/page-our-story.php', 'theme-templates/page-our-clients.php', 'theme-templates/page-mission.php', 'theme-templates/page-sustainability.php', 'theme-templates/page-distinguish.php'),
'compare' => 'IN',
)
)),
Field::make('text', 'hero_image_description', 'Descrição da Imagem')
->set_attribute('maxLength', '125')
->set_conditional_logic(array(
'relation' => 'AND',
array(
'field' => 'hero_template',
'value' => array('theme-templates/page-our-story.php', 'theme-templates/page-our-clients.php', 'theme-templates/page-mission.php', 'theme-templates/page-sustainability.php'),
'compare' => 'IN',
)
)),
Field::make('textarea', 'hero_main_description', 'Descricao Principal')
->set_attribute('maxLength', '200')
->set_conditional_logic(array(
'relation' => 'AND',
array(
'field' => 'hero_template',
'value' => array('theme-templates/page-products.php', 'theme-templates/page-hp.php', 'theme-templates/page-our-story.php', 'theme-templates/page-our-clients.php', 'theme-templates/page-sustainability.php', 'theme-templates/page-about-us.php', 'theme-templates/page-people.php'),
'compare' => 'IN',
)
)),
Field::make('text', 'hero_link', 'Link')
->set_conditional_logic(array(
'relation' => 'AND',
array(
'field' => 'hero_template',
'value' => array('theme-templates/page-hp.php'),
'compare' => 'IN',
)
)),
Field::make('image', 'hero_image', 'Imagem')
->set_conditional_logic(array(
'relation' => 'AND',
array(
'field' => 'hero_template',
'value' => array('theme-templates/page-distinguish.php', 'theme-templates/page-products.php', 'theme-templates/page-mission.php'),
'compare' => 'NOT IN',
)
)),
Field::make('hidden', 'hero_template')
]);
// Our Story
Container::make('post_meta', 'Our Story Section')
->where('post_template', '=', 'theme-templates/page-our-story.php')
->add_fields([
Field::make('textarea', 'story_main_description', 'Descrição Principal')
->set_attribute('maxLength', '600'),
Field::make('image', 'story_image_ceo', 'Imagem Banner'),
Field::make('text', 'story_ceo', 'CEO'),
Field::make('textarea', 'story_description', 'Descrição'),
Field::make('text', 'story_timeline_title', 'Titulo Timeline')
->set_attribute('maxLength', '75'),
]);
// Our Mission Page
Container::make('post_meta', 'Vision Section')
->where('post_template', '=', 'theme-templates/page-mission.php')
->add_fields([
Field::make('text', 'vision_title', 'Titulo')
->set_attribute('maxLength', '75'),
Field::make('textarea', 'vision_content', 'Descricao'),
]);
Container::make('post_meta', 'Mission Section')
->where('post_template', '=', 'theme-templates/page-mission.php')
->add_fields([
Field::make('text', 'mission_title', 'Titulo')
->set_attribute('maxLength', '75'),
Field::make('textarea', 'mission_content', 'Descricao'),
Field::make('image', 'mission_image', 'Imagem'),
]);
Container::make('post_meta', 'Values Section')
->where('post_template', '=', 'theme-templates/page-mission.php')
->add_fields([
Field::make('text', 'values_title', 'Titulo')
->set_attribute('maxLength', '75'),
Field::make('rich_text', 'values_content', 'Descricao'),
Field::make('image', 'values_image', 'Imagem'),
Field::make('text', 'values_main_description', 'Descrição Principal'),
]);
// Our Clients Section
Container::make('post_meta', 'Clients Section')
->where('post_template', 'IN', array('theme-templates/page-our-clients.php'))
->add_fields([
Field::make('media_gallery', 'clients_gallery')
->set_label('Imagens do Clientes')
->set_type(array('image'))
->set_duplicates_allowed(false)
]);
// * Product Section
Container::make('post_meta', 'Product Page Content')
->where('post_template', '=', 'theme-templates/page-products.php')
->add_fields([
Field::make('textarea', 'product_page_main_description', 'Descricao Principal')
->set_attribute('maxLength', '250'),
Field::make('textarea', 'product_page_description', 'Descricao')
->set_attribute('maxLength', '350'),
]);
Container::make('post_meta', 'Possibilidades Content')
->where('post_template', '=', 'theme-templates/page-products.php')
->add_fields([
Field::make('text', 'possibilities_main_title', 'Titulo Principal')
->set_attribute('maxLength', '50'),
Field::make('textarea', 'possibilities_main_description', 'Descricao Principal')
->set_attribute('maxLength', '300'),
Field::make('complex', 'possibilities_content', 'Conteúdo Possibilidades')
->set_layout('tabbed-horizontal')
->add_fields(array(
Field::make('text', 'possibilities_title', 'Title'),
Field::make('text', 'possibilities_description', 'Descrição'),
)),
]);
Container::make('post_meta', 'Cortiça Content')
->where('post_template', '=', 'theme-templates/page-products.php')
->add_fields([
Field::make('text', 'cortica_main_title', 'Titulo Principal')
->set_attribute('maxLength', '50'),
Field::make('text', 'cortica_main_subtitle', 'Subtitulo Principal')
->set_attribute('maxLength', '100'),
Field::make('textarea', 'cortica_main_description', 'Descricao Principal')
->set_attribute('maxLength', '300'),
Field::make('complex', 'cortica_content', 'Conteúdo Cortiça')
->set_layout('tabbed-horizontal')
->add_fields(array(
Field::make('text', 'cortica_title', 'Titulo'),
Field::make('text', 'cortica_description', 'Descrição'),
)),
]);
// * Distinguish Section
Container::make('post_meta', 'Distinguish Page Content')
->where('post_template', '=', 'theme-templates/page-distinguish.php')
->add_fields([
Field::make('textarea', 'distinguish_description', 'Descricao')
->set_attribute('maxLength', '300'),
Field::make('textarea', 'distinguish_main_description', 'Descricao Principal')
->set_attribute('maxLength', '250'),
Field::make('textarea', 'distinguish_quote', 'Quote')
->set_attribute('maxLength', '250'),
]);
Container::make('post_meta', 'Inovation Content')
->where('post_template', '=', 'theme-templates/page-distinguish.php')
->add_fields([
Field::make('text', 'distinguish_inovation_title', 'Titulo Principal')
->set_attribute('maxLength', '50'),
Field::make('textarea', 'distinguish_inovation_description', 'Descricao Principal')
->set_attribute('maxLength', '500'),
]);
Container::make('post_meta', 'Trust Content')
->where('post_template', '=', 'theme-templates/page-distinguish.php')
->add_fields([
Field::make('text', 'distinguish_trust_title', 'Titulo Principal')
->set_attribute('maxLength', '50'),
Field::make('textarea', 'distinguish_trust_description', 'Descricao Principal')
->set_attribute('maxLength', '300'),
]);
// HP Product Section
Container::make('post_meta', 'Product Section')
->where('post_template', '=', 'theme-templates/page-hp.php')
->add_fields([
Field::make('text', 'product_title', 'Titulo')
->set_attribute('maxLength', '50'),
Field::make('textarea', 'product_main_description', 'Descricao Principal')
->set_attribute('maxLength', '250'),
Field::make('textarea', 'product_description', 'Descricao')
->set_attribute('maxLength', '500'),
Field::make('text', 'product_after_description', 'Descricao Após')
->set_attribute('maxLength', '200'),
]);
// Testimonials Section
Container::make('post_meta', 'Testimonials Section')
->where('post_template', '=', 'theme-templates/page-hp.php')
->add_fields([
Field::make('text', 'testimonials_title', 'Titulo')
->set_attribute('maxLength', '75'),
]);
/* Contact Page */
Container::make('post_meta', 'Map Section')
->where('post_template', '=', 'theme-templates/page-contact.php')
->add_fields([
Field::make('text', 'contact_title', 'Titulo')
->set_attribute('maxLength', '75'),
Field::make('textarea', 'contact_description', 'Descricao')
->set_attribute('maxLength', '350'),
Field::make('image', 'map_image', 'Imagem Mapa'),
]);
Container::make('post_meta', 'Form Section')
->where('post_template', '=', 'theme-templates/page-contact.php')
->add_fields([
Field::make('text', 'contact_form_title', 'Titulo Formulario'),
Field::make('text', 'contact_form', 'Formulario de Contacto'),
Field::make('image', 'contact_image', 'Imagem Rolha'),
]);
// * Policy Page */
Container::make('post_meta', 'Policy Sections')
->where('post_template', '=', 'theme-templates/page-policy.php')
->add_fields([
Field::make('complex', 'policy_content', 'Conteúdo')
->set_layout('tabbed-horizontal')
->add_fields(array(
Field::make('text', 'policy_tab_title', 'Title'),
Field::make('rich_text', 'policy_tab_description', 'Description'),
)),
]);
});
/* Timeline */
add_action('carbon_fields_register_fields', function () {
// Timeline Section
Container::make('post_meta', 'Timeline')
->where('post_template', '=', 'theme-templates/page-our-story.php')
->add_fields([
Field::make('complex', 'timeline', 'Conteúdo')
->set_layout('tabbed-horizontal')
->add_fields(array(
Field::make('radio_image', 'timeline_type', 'Imagem Posição')
->add_options(array(
'no' => '/wp-content/themes/jcr/assets/no_image.png',
'left' => '/wp-content/themes/jcr/assets/left-image.png',
'right' => '/wp-content/themes/jcr/assets/right-image.png',
'bottom' => '/wp-content/themes/jcr/assets/bottom-image.png',
)),
Field::make('text', 'timeline_year', 'Ano'),
Field::make('textarea', 'timeline_content', 'Conteúdo'),
Field::make('image', 'timeline_image', 'Image')
->set_conditional_logic(array(
'relation' => 'AND',
array(
'field' => 'timeline_type',
'value' => 'no',
'compare' => '!=',
)
)),
Field::make('multiselect', 'timeline_options', 'Opções')
->add_options(array(
'featured_text' => 'Texto em Destaque',
'image_overflow' => 'Imagem Overflow',
'image_max_width' => 'Imagem Width Limite',
))
)),
]);
});
// * Docs Page */
add_action('carbon_fields_register_fields', function () {
Container::make('post_meta', 'Documentos')
->where('post_template', '=', 'theme-templates/page-docs.php')
->add_fields([
Field::make('complex', 'docs_content', 'Conteúdo')
->set_layout('tabbed-horizontal')
->add_fields(array(
Field::make('text', 'docs_title', 'Title'),
Field::make('file', 'docs_file', 'Ficheiro')
->set_value_type( 'url' ),
)),
]);
});
add_action('carbon_fields_register_fields', function () {
Container::make('post_meta', 'News Hero Section')
->where('post_id', 'IN', array(get_option('page_for_posts')))
->add_fields([
Field::make('text', 'news_hero_subtitle', 'Subtitle'),
Field::make('text', 'news_hero_title', 'Titulo')
->set_attribute('maxLength', '75'),
Field::make('textarea', 'news_hero_main_description', 'Descricao Principal')
->set_attribute('maxLength', '200'),
Field::make('textarea', 'news_hero_description', 'Descricao')
->set_attribute('maxLength', '350'),
Field::make('image', 'news_hero_image', 'Imagem')
]);
});
// Sustainability Page
add_action('carbon_fields_register_fields', function () {
Container::make('post_meta', 'Sustentabilidade')
->where('post_template', '=', 'theme-templates/page-sustainability.php')
->add_fields([
Field::make('textarea', 'sustainability_content', 'Descricao'),
]);
Container::make('post_meta', 'Compromisso Ambiental')
->where('post_template', '=', 'theme-templates/page-sustainability.php')
->add_fields([
Field::make('text', 'comp_ambiental_title', 'Titulo')
->set_attribute('maxLength', '75'),
Field::make('textarea', 'comp_ambiental_content', 'Descricao'),
Field::make('textarea', 'comp_ambiental_main_description', 'Descricao Principal'),
Field::make('image', 'comp_ambiental_image', 'Imagem'),
]);
Container::make('post_meta', 'Cortiça')
->where('post_template', '=', 'theme-templates/page-sustainability.php')
->add_fields([
Field::make('text', 'cortica_sustainability_title', 'Titulo')
->set_attribute('maxLength', '75'),
Field::make('textarea', 'cortica_sustainability_description', 'Descricao'),
Field::make('complex', 'cortica_sustainability_content', 'Conteúdo')
->set_layout('tabbed-horizontal')
->add_fields(array(
Field::make('text', 'cortica_content_title', 'Title'),
)),
]);
Container::make('post_meta', 'Compromisso Social')
->where('post_template', '=', 'theme-templates/page-sustainability.php')
->add_fields([
Field::make('text', 'comp_social_title', 'Titulo')
->set_attribute('maxLength', '75'),
Field::make('textarea', 'comp_social_content', 'Descricao'),
Field::make('image', 'comp_social_image', 'Imagem'),
]);
Container::make('post_meta', 'Compromisso Económico')
->where('post_template', '=', 'theme-templates/page-sustainability.php')
->add_fields([
Field::make('text', 'comp_economico_title', 'Titulo')
->set_attribute('maxLength', '75'),
Field::make('textarea', 'comp_economico_content', 'Descricao'),
Field::make('textarea', 'comp_economico_main_description', 'Descricao Principal'),
]);
Container::make('post_meta', 'Certificações Excelência')
->where('post_template', '=', 'theme-templates/page-sustainability.php')
->add_fields([
Field::make('text', 'cert_excelencia_title', 'Titulo')
->set_attribute('maxLength', '75'),
Field::make('textarea', 'cert_excelencia_content', 'Descricao'),
Field::make('image', 'cert_excelencia_image', 'Imagem'),
]);
});
// * People Page
add_action('carbon_fields_register_fields', function () {
Container::make('post_meta', 'People Main Section')
->where('post_template', '=', 'theme-templates/page-people.php')
->add_fields([
Field::make('text', 'people_title', 'Titulo'),
Field::make('textarea', 'people_description', 'Descrição'),
Field::make('image', 'people_image', 'Imagem'),
Field::make('textarea', 'people_image_description', 'Descricao Imagem'),
Field::make('text', 'candidatura_section_title', 'Titulo Candidatura')
->set_attribute('maxLength', '150'),
Field::make('text', 'candidatura_section_description', 'Descrição Candidatura')
->set_attribute('maxLength', '150'),
]);
Container::make('post_meta', 'Candidatura')
->where('post_template', '=', 'theme-templates/page-people.php')
->add_fields([
Field::make('text', 'candidatura_title', 'Titulo'),
Field::make('textarea', 'candidatura_description', 'Descrição'),
Field::make('text', 'candidatura_link', 'Link'),
]);
Container::make('post_meta', 'Funções Aberto')
->where('post_template', '=', 'theme-templates/page-people.php')
->add_fields([
Field::make('text', 'funcoes_title', 'Titulo'),
Field::make('textarea', 'funcoes_description', 'Descrição'),
Field::make('text', 'funcoes_link', 'Link'),
]);
});
add_action('carbon_fields_register_fields', function () {
// Product Section
Container::make('post_meta', 'Product Images')
->where('post_type', '=', 'product')
->add_fields([
Field::make('complex', 'product_content', 'Conteúdo')
->set_layout('tabbed-horizontal')
->add_fields(array(
Field::make('text', 'product_title', 'Title'),
Field::make('image', 'product_image', 'Image'),
)),
]);
Container::make('post_meta', 'Product Options')
->where('post_type', '=', 'product')
->set_context( 'side' )
->add_fields([
Field::make( 'checkbox', 'product_featured', __( 'Is Featured' ) )
->set_option_value( 'no' )
]);
});
// * Testimonials Post Type
add_action('carbon_fields_register_fields', function () {
// Testimonials Section
Container::make('post_meta', 'Testimonials Section')
->where('post_type', '=', 'testimonial')
->add_fields([
Field::make('text', 'testimonial_client', 'Cliente')
->set_required(true)
->set_attribute('maxLength', '50'),
Field::make('text', 'testimonial_role', 'Cliente Cargo')
->set_required(true)
->set_attribute('maxLength', '50'),
Field::make('textarea', 'testimonial_content', 'Testemunho')
->set_required(true)
->set_attribute('maxLength', '500'),
Field::make('image', 'testimonial_image', 'Imagem')
->set_width(50),
]);
});
// * About us Page
add_action('carbon_fields_register_fields', function () {
// About Us Section
Container::make('post_meta', 'About Us Section')
->where('post_template', '=', 'theme-templates/page-about-us.php')
->add_fields([
Field::make('text', 'about_us_title', 'Titulo')
->set_attribute('maxLength', '50'),
Field::make('textarea', 'about_us_title_description', 'Titulo Descrição'),
Field::make( 'file', 'about_us_video', __( 'Video' ) )
->set_type( array( 'video') )
->set_value_type( 'url' ),
Field::make('textarea', 'about_us_description', 'Descrição'),
Field::make('textarea', 'about_us_main_description', 'Descrição Principal'),
]);
});
// * Clients Page
add_action('carbon_fields_register_fields', function () {
// Clients Section
Container::make('post_meta', 'Clients Section')
->where('post_template', '=', 'theme-templates/page-our-clients.php')
->add_fields([
Field::make('text', 'title', 'Titulo')
->set_attribute('maxLength', '100'),
Field::make('textarea', 'description', 'Descrição'),
]);
});
// * Vagas Post Type
add_action('carbon_fields_register_fields', function () {
// Vagas Section
Container::make('post_meta', 'Vagas Section')
->where('post_type', '=', 'vaga')
->add_tab( __('Vaga Informação'), array(
Field::make('text', 'vaga_location', 'Localização')
->set_required(true)
->set_attribute('maxLength', '100'),
Field::make('select', 'vaga_work_model', 'Modelo de Trabalho')
->add_options( array(
'full_time' => 'Full-Time',
'part_time' => 'Part-Time',
))
->set_required(true),
Field::make('select', 'vaga_workspace', 'Workspace')
->add_options( array(
'remoto' => 'Remoto',
'presencial' => 'Presencial',
))
->set_required(true),
) )
->add_tab( __('Vaga Detalhes'), array(
Field::make('rich_text', 'vaga_info', 'Vaga Detalhes')
->set_required(true),
Field::make('rich_text', 'vaga_responsabilities', 'Vaga Responsabilidades')
->set_required(true),
) );
});
add_action('carbon_fields_register_fields', 'taxonomy_image_field');
function taxonomy_image_field()
{
Container::make('term_meta', __('Categoria', 'jcr'))
->where('term_taxonomy', '=', 'product-category')
->add_fields([
Field::make('text', 'subtitle', 'Subtitle'),
Field::make('text', 'title', 'Titulo')
]);
Container::make('term_meta', __('Hero da Categoria', 'jcr'))
->where('term_taxonomy', '=', 'product-category')
->add_fields([
Field::make('text', 'hero_subtitle', 'Hero Subtitle'),
Field::make('text', 'hero_title', 'Hero Titulo')
->set_attribute('maxLength', '75'),
Field::make('textarea', 'hero_description', 'Hero Descricao')
->set_attribute('maxLength', '650'),
]);
Container::make('term_meta', __('Conteúdo Categoria', 'jcr'))
->where('term_taxonomy', '=', 'product-category')
->add_fields([
Field::make('textarea', 'category_page_description', 'Descricao Principal')
->set_attribute('maxLength', '150'),
]);
Container::make('term_meta', __('Imagem da Categoria', 'jcr'))
->where('term_taxonomy', '=', 'product-category')
->add_fields(array(
Field::make('image', 'category_image', __('Imagem', 'jcr'))
->set_help_text(__('Selecione uma imagem para esta categoria', 'jcr')),
Field::make('text', 'order', 'Ordem')
->set_attribute('type', 'number')
->set_default_value(0),
Field::make('association', 'category_featured_product', __('Produto em Destaque', 'jcr'))
->set_max(1)
->set_types(array(
array(
'type' => 'post',
'post_type' => 'product',
),
))
));
}
add_action('carbon_fields_register_fields', 'article_description_image');
function article_description_image()
{
Container::make('post_meta', __('Descrição Imagem', 'jcr'))
->where('post_type', '=', 'post')
->set_context('side')
->set_priority('low')
->add_fields(array(
Field::make('text', 'description_image', __('Descrição', 'jcr'))
->set_help_text(__('Preencha a descrição da imagem', 'jcr')),
));
}
/*add_filter('carbon_fields_container_is_valid_attach', function ($is_valid, $container) {
if (get_post_type() !== 'page') {
return $is_valid;
}
$template = get_page_template_slug(get_the_ID());
switch ($container->get_name()) {
case 'hero_section':
$is_valid = in_array($template, [
'theme-templates/page-home.php',
'theme-templates/page-products.php'
]);
break;
case 'product_section':
case 'testimonials_section':
$is_valid = true;
break;
case 'map_section':
case 'form_section':
$is_valid = $template === 'theme-templates/page-contact.php';
break;
}
return $is_valid;
}, 10, 2);*/
class Custom_Walker_Nav_Menu extends Walker_Nav_Menu {
public function start_el(&$output, $item, $depth = 0, $args = null, $id = 0) {
$classes = empty($item->classes) ? array() : (array) $item->classes;
$class_names = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item, $args, $depth));
$class_names = $class_names ? ' class="' . esc_attr($class_names) . '"' : '';
$id = apply_filters('nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args, $depth);
$id = $id ? ' id="' . esc_attr($id) . '"' : '';
$output .= '
';
$attributes = !empty($item->attr_title) ? ' title="' . esc_attr($item->attr_title) .'"' : '';
$attributes .= !empty($item->target) ? ' target="' . esc_attr($item->target) .'"' : '';
$attributes .= !empty($item->xfn) ? ' rel="' . esc_attr($item->xfn) .'"' : '';
$attributes .= !empty($item->url) ? ' href="' . esc_attr($item->url) .'"' : '';
$item_output = $args->before;
$item_output .= '';
$item_output .= $args->link_before . apply_filters('the_title', $item->title, $item->ID) . $args->link_after;
$item_output .= ' ';
if (in_array('menu-item-has-children', $classes)) {
$item_output .= ' ';
}
$item_output .= $args->after;
$output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args);
}
}
function register_custom_walker_nav_menu($args) {
$args['walker'] = new Custom_Walker_Nav_Menu();
return $args;
}
add_filter('wp_nav_menu_args', 'register_custom_walker_nav_menu');
?>
Deprecated : WPML_Translations::__construct(): Implicitly marking parameter $wpml_cache as nullable is deprecated, the explicit nullable type must be used instead in /home/ptcnspt/jcribeiro.ptcns.pt/wp-content/plugins/sitepress-multilingual-cms/classes/translations/class-wpml-translations.php on line 26
Deprecated : WPML_Translation_Element::__construct(): Implicitly marking parameter $wpml_cache as nullable is deprecated, the explicit nullable type must be used instead in /home/ptcnspt/jcribeiro.ptcns.pt/wp-content/plugins/sitepress-multilingual-cms/classes/translations/class-wpml-translation-element.php on line 27
Page Not Found - JCRibeiro
Oops! That page can’t be found.
It looks like nothing was found at this location. Maybe try one of the links below or a search?
$image_footer = carbon_get_theme_option('jcr_footer_image');
$image_footer_link = crb_get_i18n_theme_option('jcr_footer_image_link');
$logo_footer = carbon_get_theme_option('jcr_footer_logo') ?>
Deprecated : WPML\Core\Component\Translation\Domain\Links\HandleUpdateTranslation::adjustOnlyOnce(): Implicitly marking parameter $triggerItem as nullable is deprecated, the explicit nullable type must be used instead in /home/ptcnspt/jcribeiro.ptcns.pt/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wpml/src/Core/Component/Translation/Domain/Links/HandleUpdateTranslation.php on line 75
Deprecated : WPML\Legacy\Component\Translation\Domain\Links\AdjustLinks::adjust(): Implicitly marking parameter $triggerItem as nullable is deprecated, the explicit nullable type must be used instead in /home/ptcnspt/jcribeiro.ptcns.pt/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wpml/src/Legacy/Component/Translation/Domain/Links/AdjustLinks.php on line 22
Deprecated : WPML\Legacy\Component\Translation\Domain\Links\AdjustLinks::adjustLinksInStringTranslations(): Implicitly marking parameter $triggerItem as nullable is deprecated, the explicit nullable type must be used instead in /home/ptcnspt/jcribeiro.ptcns.pt/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wpml/src/Legacy/Component/Translation/Domain/Links/AdjustLinks.php on line 70
Deprecated : WPML\Legacy\Component\Translation\Domain\Links\AdjustLinks::revertNameInTranslatedLinks(): Implicitly marking parameter $triggerItem as nullable is deprecated, the explicit nullable type must be used instead in /home/ptcnspt/jcribeiro.ptcns.pt/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wpml/src/Legacy/Component/Translation/Domain/Links/AdjustLinks.php on line 121
Deprecated : WPML\Core\Component\Translation\Domain\Links\AdjustLinksInterface::adjust(): Implicitly marking parameter $triggerItem as nullable is deprecated, the explicit nullable type must be used instead in /home/ptcnspt/jcribeiro.ptcns.pt/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wpml/src/Core/Component/Translation/Domain/Links/AdjustLinksInterface.php on line 12