| | |
| | | function altr_faq():array |
| | | { |
| | | return [ |
| | | 'singular' => 'Frequently Asked Question', |
| | | 'plural' => 'Frequently Asked Questions', |
| | | 'singular' => 'FAQ', |
| | | 'plural' => 'FAQs', |
| | | 'dash_description' => 'Manage your answers', |
| | | 'capability_type' => ['faq', 'faqs'], |
| | | 'breadcrumb' => 'FAQ', |
| | |
| | | ], |
| | | 'single_image' => false, |
| | | 'upload_title' => 'Upload Before & Afters', |
| | | 'seo' => [ |
| | | 'meta' => [ |
| | | 'title' => '{{post_title}} | FAQ', |
| | | 'description' => '{{post_excerpt}}' |
| | | ], |
| | | 'schema' => [ |
| | | 'type' => 'FAQPage', |
| | | 'question' => '{{post_title}}', |
| | | 'answer' => '{{post_excerpt}}', |
| | | ], |
| | | 'archive' => [ |
| | | 'type' => 'FAQPage', |
| | | 'name' => 'Common Questions about Laser Tattoo Removal', |
| | | ], |
| | | ] |
| | | ]; |
| | | } |
| | | |
| | |
| | | '; |
| | | // $output = wp_add_inline_script('jvb-form', $script, 'after'); |
| | | } |
| | | } |
| | | |
| | | add_filter('jvbBreadcrumbs', 'altrFAQCrumbs'); |
| | | function altrFAQCrumbs(array $crumbs) { |
| | | if (is_singular(BASE.'faq')) { |
| | | $ID = get_the_ID(); |
| | | $terms = get_the_terms($ID, BASE.'section'); |
| | | if ($terms && !is_wp_error($terms)) { |
| | | $last = array_pop($crumbs); |
| | | $term = $terms[0]; |
| | | $ancestors = get_ancestors($term->term_id, BASE.'section', 'taxonomy'); |
| | | $ancestors = array_reverse($ancestors); |
| | | foreach ($ancestors as $ancestor) { |
| | | $aTerm = get_term($ancestor, BASE.'section'); |
| | | if ($aTerm && !is_wp_error($aTerm)) { |
| | | $crumbs[] = [ |
| | | 'name' => $aTerm->name, |
| | | 'url' => get_term_link($ancestor, BASE.'section') |
| | | ]; |
| | | } |
| | | } |
| | | $crumbs[] = [ |
| | | 'name' => $term->name, |
| | | 'url' => get_term_link($term, BASE.'section') |
| | | ]; |
| | | $crumbs[] = $last; |
| | | } |
| | | } |
| | | return $crumbs; |
| | | } |