-
Author
-
May 16, 2015 at 11:36 #59027ImGParticipant
I have created custom post type using “Custom Post Type UI” plugin, In theme options-> Display meta fields i have selected “Categories” to show and turn on-> Display post meta on archive listing, Display post meta in Single post page, but categories are not showing on custom post type single post page and cpt archieves, how to solve this issue, and also social share and post likes are not showing on cpt pages, what to do?
May 17, 2015 at 05:53 #59142LauraModeratorHello, have you tried talking to the plugin support forum? You can also share your admin credentials so i can check it out 🙂
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
May 17, 2015 at 16:16 #59185sharmstrModeratorHave you enabled social sharing for your CPT? Theme Options > Social Share > Social share Post types
That’s correct. Kleo uses WP taxonomies. You can either enable WP categories for your CPT or you can copy the kleo_entry_meta() function located in /kleo/functions.php into your child them and add it yourself. You can use this function to retrieve them: https://codex.wordpress.org/Function_Reference/get_the_terms
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
May 17, 2015 at 16:34 #59189sharmstrModeratorI just found some code I used on another site over a year ago. Totally forgot about it. See if this helps.
At the top of the kleo_entry_meta function you’ll see.
COPY CODE// Translators: used between list items, there is a space after the comma. if ( in_array( 'categories', $meta_elements ) ) { $categories_list = get_the_category_list(__(', ', 'kleo_framework')); }
Try something like this instead.
COPY CODEif (get_post_type() == 'projects') { $categories_list = get_the_term_list( $post->ID, 'project-category', '', ', ' ); } else { // Translators: used between list items, there is a space after the comma. if ( in_array( 'categories', $meta_elements ) ) { $categories_list = get_the_category_list(__(', ', 'kleo_framework')); } }
Be sure to change projects and project-category to match your setup.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
May 17, 2015 at 16:35 #59190sharmstrModeratorAgain, make sure you put it in your child theme’s function.php file.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
May 19, 2015 at 06:37 #59370ImGParticipantHi the code what you have given doesn’t retrieve any category attached to Projects CPT, I have placed this code in functions.php of child theme`
if (get_post_type() == ‘project’) {
$categories_list = get_the_term_list( $post->ID, ‘project_categories’, ”, ‘, ‘ );
} else {
// Translators: used between list items, there is a space after the comma.
if ( in_array( ‘categories’, $meta_elements ) ) {
$categories_list = get_the_category_list(__(‘, ‘, ‘kleo_framework’));
}
}`
Any solution!May 19, 2015 at 06:56 #59371sharmstrModeratorYou have to put the entire kleo_entry_meta function into your child functions.php file. Not just the code I told you to change.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
May 20, 2015 at 06:15 #59527ImGParticipantHi, Can you tell me in which file kleo_entry_meta function is located?
May 20, 2015 at 06:31 #59532sharmstrModeratorI did 🙂
you can copy the kleo_entry_meta() function located in /kleo/functions.php
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
May 21, 2015 at 06:19 #59691ImGParticipantHi, I have placed entire kleo_entry_meta() function but it is not working, i thing if it works it will work for project cpt, for other post type it won’t work, Here is the code that i have placed in functions.php`if ( ! function_exists( ‘kleo_entry_meta’ ) ) :
/**
* Prints HTML with meta information for current post: categories, tags, permalink, author, and date.
* Create your own kleo_entry_meta() to override in a child theme.
* @since 1.0
*/
function kleo_entry_meta($echo=true, $att=array()) {global $kleo_config;
$meta_list = array();
$author_links = ”;
$meta_elements = sq_option( ‘blog_meta_elements’, $kleo_config[‘blog_meta_defaults’] );if (get_post_type() == ‘project’) {
$categories_list = get_the_term_list( $post->ID, ‘project_categories’, ”, ‘, ‘ );
} else {
// Translators: used between list items, there is a space after the comma.
if ( in_array( ‘categories’, $meta_elements ) ) {
$categories_list = get_the_category_list(__(‘, ‘, ‘kleo_framework’));
}
}// Translators: used between list items, there is a space after the comma.
if ( in_array(‘tags’, $meta_elements ) ) {
$tag_list = get_the_tag_list(”, __(‘, ‘, ‘kleo_framework’));
}$date = sprintf( ‘<a href=”%1$s” rel=”bookmark” class=”post-time”>’ .
‘<time class=”entry-date” datetime=”%2$s”>%3$s</time>’ .
‘<time class=”modify-date hide hidden updated” datetime=”%4$s”>%5$s</time>’ .
‘</a>’,
esc_url( get_permalink() ),
esc_attr( get_the_date( ‘c’ ) ),
esc_html( get_the_date() ),
esc_html( get_the_modified_date( ‘c’ ) ),
esc_html( get_the_modified_date() )
);`
Any solution!May 21, 2015 at 15:15 #59728sharmstrModeratorI dont know what to tell you. The code works for me. Have you tried troubleshooting? Have you verified that
COPY CODEget_the_term_list( $post->ID, ‘project_categories’, ”, ‘, ‘ );
returns something?
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
-
AuthorPosts
The forum ‘KLEO’ is closed to new topics and replies.