Skip to content

Commit

Permalink
shortcode plugin created and added first button shortcode
Browse files Browse the repository at this point in the history
  • Loading branch information
ashrafbd1496 committed Aug 12, 2021
1 parent cb930a7 commit 803b814
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ function philosophy_home_banner_class($class_name){

remove_action('philosophy_after_category_title','text_after_category_title2',8);



//function for collection custom post type link/url
function philosophy_cpt_slug_link( $post_link, $id ) {
$pid = get_post($id);
Expand All @@ -230,10 +232,22 @@ function philosophy_cpt_slug_link( $post_link, $id ) {
$post_link = str_replace('%book%',$parent_post->post_name,$post_link);
}
}
// if(is_object($pid) && 'book'==get_post_type($pid)){
// $genre = wp_get_post_terms($pid->ID,'genre');
// if(is_array($genre) && count($genre)>0){
// $slug = $genre[0]->slug;
// $post_link = str_replace('%genre%',$slug,$post_link);
// }else{
// $slug = 'generic';
// $post_link = str_replace('%genre%',$slug,$post_link);
// }
// }
return $post_link;
}

add_filter( 'post_type_link', 'philosophy_cpt_slug_link', 1, 2 );


function philosophy_tags_heading_language($title){
if(is_post_type_archive('book') || is_tax('language')){
$title = __('Languages','philosophy');
Expand Down

0 comments on commit 803b814

Please sign in to comment.