Hello @yuko999,
Sorry for the late reply,
Your code is working fine, but please check the plugins conflicts:
Please check these screenshots:
https://postimg.cc/gallery/zrq2J2L
function OWP_CPT_entry_meta() {
global $post;
if ($post->post_type == 'post' || $post->post_type == 'gallery') {
?>
<ul class="meta clr">
<li class="meta-date"<?php oceanwp_schema_markup( 'publish_date' ); ?>><i class="icon-clock"></i><?php echo get_the_date(); ?>
<li class="meta-cat"><i class="icon-folder"></i><?php the_category( ' / ', get_the_ID() ); ?>
<?php
}
}
add_filter('ocean_blog_entry_meta','OWP_CPT_entry_meta');
function OWP_CPT_single_meta() {
global $post;
if ($post->post_type == 'post' || $post->post_type == 'gallery') {
?>
<ul class="meta clr">
<li class="meta-date"<?php oceanwp_schema_markup( 'publish_date' ); ?>><i class="icon-clock"></i><?php echo get_the_date(); ?>
<li class="meta-cat"><i class="icon-folder"></i><?php the_category( ' / ', get_the_ID() ); ?>
<?php
}
}
add_filter('ocean_blog_single_meta','OWP_CPT_single_meta');
For troubleshooting, please do the following steps and let me the results:
1- Head over to WP Dashboard > Plugin.
2- Deactivate all plugins.
3- Then, first activate the Ocean Extra plugin.
4- Check your issue.
5- Then, activate your plugins one by one
6- After activation of any plugins, check your issue
Note: if you have a cache plugin or server cache. You need to clear its cache contents or disable them.
Update: If you use the custom post type, it’s better to create a new file as an archive page. e.g., archive-gallery.php and include it into the child theme root: https://docs.oceanwp.org/article/90-sample-child-theme.
Best Regards
-
This reply was modified 3 years, 3 months ago by Shahin.