To insert code use <code>...</code>.
Don't display meta data by Post ID
  • Is there a way to override the global setting to NOT display meta data in the header area of posts (Date, Comments, etc.) based upon post ID? In other words, I have my blog set to display Meta data in the header and I want it to display that way on the blog page, but, I have another page where I am only showing a certain category of posts. On that page I do not want meta data to show at all. Can I add custom CSS to say not to display that Meta data based upon those posts (or better yet, on category since I won't have to update the CSS every time I add a new post to that category?).
  • 7 Comments sorted by
  • Hi,

    You can turn meta data off / on global in the blog settings.

    You cannot turn meta data off on a category bases.

    However you can use the blog shortcode to display a blog page without meta data.

    Best regards,
    BackuPs
  • Right. I've done that.

    So, in the Striking>Blog section there is the following field:

    Show in Header Area (Turned on the Blog title and meta info will show in header text area. Turned off the Blog title and meta info will be shown in the page itself).

    I have that field set to off, so meta data on an individual view of a post will not show in the header but will show on the page. This is fine for my Blog page.

    However, I created another page using shortcode as you suggested just to show one categories posts. Within the shortcode I set meta data to off. This works great on the page (when you are viewing the list of posts for the category I'm showing). But, once you click on any of those posts and go to view only the individual post, the meta data is there again. It does not show on the page where I set the shortcode, but it does show on the individual page view.

    How can I make it so that the meta data does not show in the individual post view when I've set the meta data to off from the original page using shortcode?
  • Shouldn't I be able to update the get_post_meta in way so that post IDs that I don't want to have meta on the single post page won't show that data? Can't I update the single.php file in a way that excludes certain IDs?

    <?php<br />$blog_page = theme_get_option('blog','blog_page');
    if($blog_page == $post->ID){
    return require(THEME_DIR . "/template_blog.php");
    }
    $layout = get_post_meta($post->ID, '_layout', true);
    if(empty($layout) || $layout == 'default'){
    $layout=theme_get_option('blog','single_layout');
    }
    $featured_image_type = theme_get_option('blog', 'single_featured_image_type');
    ?>
  • Does any PHP experts know if I can manipulate the above code to exclude specific IDs from displaying meta on the single post view? Changing settings at the global level does NOT solve the problem for me. Thanks!
  • Anybody? The above PHP must have a way to modify to exclude certain posts based upon Post ID....
  • David, we will get back to you on this, either I or Lin, once we get out of the direct support issues etc for the theme.

    Best Regards
    Striking Team
    James
  • No problem. I am working around it for now. Thanks. I don't think that I posted the right place to modify the php anyway...