• Skip to main content
  • Skip to primary sidebar

WordPress, Genesis Framework and Storefront customization tutorials

  • Archive
    • Genesis
    • WooCommerce
    • WordPress
  • Premium
  • Blog
  • About
    • Tools I Use
  • Contact
  • Login
Home » CPT

CPT

Echo custom post type taxonomy name and slug with function

2021-01-07 by Gabor Leave a Comment

Filed Under: WordPress Tagged With: CPT, name, slug, taxonomy

How to fix Yoast breadcrumb in Custom Post Types

2019-02-09 by Gabor Leave a Comment

Create a file called breadcrumb-fix.php

<div class="breadcrumb-wrapper">
<?php
    if ( function_exists('yoast_breadcrumb') ){
    
            if(get_post_type() == 'szolgaltatas'){

                include('breadcrumb-services.php');  
            }
            elseif(get_post_type() == 'post'){

                include('breadcrumb-post.php');  
            }
            else { 
                    yoast_breadcrumb( '<p id="breadcrumbs">','</p>' ); 
                } 
        }
?>
</div>

Create another file

<p id="breadcrumbs">
        <span xmlns:v="http://rdf.data-vocabulary.org/#">
            <span typeof="v:Breadcrumb">
                <a href="<?php echo home_url(); ?>/" rel="v:url" property="v:title">
                    wtsklient.hu
                </a>
            </span>
                <i class="fas fa-chevron-right"></i>
            <span typeof="v:Breadcrumb">
                    <?php lang_post_breadcrumbs(); ?>
            </span>
                <i class="fas fa-chevron-right"></i>
            <span typeof="v:Breadcrumb">
                <span class="breadcrumb_last" property="v:title">
                    <?php the_title(); ?>
                </span>
            </span>
        </span>
</p>

Create a function for 3 languages

/****************************************************
//BREADCRUMBS POSTS
****************************************************/
function lang_post_breadcrumbs(){
    if(ICL_LANGUAGE_CODE=='hu'){
        echo '<a href="#">Hírek</a>';
        }
    elseif(ICL_LANGUAGE_CODE=='en'){
        echo '<a href="#">News</a>';    
        }
    elseif(ICL_LANGUAGE_CODE=='de'){
        echo '<a href="#">Nachrichten</a>';    
        }
}

Filed Under: WordPress Tagged With: Breadcrumb, CPT, Yoast

Primary Sidebar

  • Facebook
  • GitHub
  • Instagram
  • LinkedIn
  • Twitter
  • YouTube
WP Rocket - WordPress Caching Plugin
UpdraftPlus Premium

Disclosure: Some of the links in this site are affiliate links. I will be paid a commission if you use this link to make a purchase.

  • Privacy Policy
  • Flames Design
© 2021 WP Flames - All Right Reserved