Post format kill meta info?
-
CreatorTopic
-
December 22, 2012 at 6:26 am #1678
karlo
ParticipantTutorial on implementing post format here http://dev.themeblvd.com/tutorial/incorporating-post-formats/ works fine but it take out meta info/show_meta. For all posts! And without ever making a post format posts. A content-link.php does kick in, is only a meta issue.
I checked this http://support.themeblvd.com/forums/topic/single-post-meta-information-post-listgrid-pagination/ and found that your fix about changing “,” to “=>” fix single posts but not front/home/list of posts/loop what ever. I think problem is the same but not 100% final fix is so post this to be sure you know. If you can confirm that is.
-
CreatorTopic
-
AuthorReplies
-
December 22, 2012 at 6:34 am #1679
karlo
ParticipantHello again,
I tried to edit post because it is so boring but then I see an error
ERROR: Forum ID is missing.
May be you should have a “general” sub-forum for these things?
Now I have problem because getting off-topic, heh.
Possibly saved: Snippet inserting inline comments where get template part starts, nifty and somewhat relevant. If not just remove this post.
/* SHOW ALL TEMPLATES, ALSO GET_TEMPLATE - http://wordpress.stackexchange.com/a/30993/9470 */ add_action('all','template_snoop'); function template_snoop(){ $args = func_get_args(); if( !is_admin() and $args[0] ){ if( $args[0] == 'template_include' ) { echo "\n"; } elseif( strpos($args[0],'get_template_part_') === 0 ) { global $last_template_snoop; if( $last_template_snoop ) echo "\n\n"; $tpl = rtrim(join('-', array_slice($args,1)),'-').'.php'; echo "\n\n\n"; $last_template_snoop = $tpl; } } }
December 22, 2012 at 10:30 pm #1685Jason Bobich
Keymasterlol, you’re kind of losing me here, but I’ll try to answer from what I’m following in your topic.
Yes, there is currently a bug in the framework with the logic of how single post meta is determined. It doesn’t work properly because of the typo you saw referenced in the other thread. This will be fixed in the next update. But this doesn’t really have anything to do with the post formats tutorial you’re linking to other than the fact that you’re switching to use a template part that no longer accommodates that setting.
So why is this? — This is because the whether or not meta info shows on the single post page is ultimately determined by what’s in that template part.
Putting the current framework bug aside, by default, the framework uses
content.php
to display single posts, and that is the only thing that file is responsible for. And so it holds a simple check to determine whether or not the single post meta shows.So, if you follow this tutorial, you’re now changing the entire structure of how things work, and so you need to accomodate for that in your template part files.
For example, if you create a
content-link.php
, and you want to use that for Link format posts on both a post list and single posts, and you want that single post meta option to still work, you need to accomodate for that something like this:<?php if( themeblvd_get_att( 'show_meta' ) ) : ?>
<?php themeblvd_blog_meta(); ?><?php endif; ?>This is difficult to explain. I don’t really have it documented yet how the
themeblvd_get_att
andthemeblvd_set_att
function work, but basically that’s how I’m passing parameters through to the template parts. So for example when the page loads (current bug aside), the framework looks for it being a single post, then determines whether or not to set “show_meta” parameter as true or not. But by checkingif( themeblvd_get_att( 'show_meta' ) ) :
in the template part file, we can see if it’s currently set to show or not.However this is sort of tricky because on the post list, this isn’t going to be true and so the meta info won’t show there. It seems to me that it would be most logical that if you were going to the extent of programming in your post format files, you’d just remove the option for the user and determine yourself, as the developer, how posts should look in each scenario.
December 22, 2012 at 11:17 pm #1692karlo
ParticipantI understand more than yesterday. Tthose template files are supposed to be powerful and used when normal CSS fiddling based on new post format class is not enough. If not unique why bother? must be the idea.
Full text search in framework files is not waste of time 🙂
December 22, 2012 at 11:32 pm #1694Jason Bobich
KeymasterI have a theme on ThemeForest that uses this framework and incorporates post formats. In that theme many of the template parts for each post format have different markup, and so it makes sense there.
http://www.themeblvd.com/demo/arcadian/category/post-formats/
So, it all depends on what you want to do. How you want to call the template parts is totally up to you and your design, I guess. You can also have just one file like content.php where you have all of these if/else statements all over the place depending on the post format. I sort of think it’s more simple to have a simple template part file for each post format, but that’s just personal preference.
December 23, 2012 at 5:12 am #1696karlo
ParticipantYes I prefer that too so will keep testing. I can see there are no issues with index.php, template-list.php vs. meta data in that link. Show up in category and on front.
I only use a copy of content.php for content-link.php. And that means every posts, including std. format, gets meta block removed when not in single view, and set to full content = I must be doing something wrong.
If I remove the single view show_meta check, meta does show up since forced. Not like data has gone missing. If I do that for all content-XXX.php + content.php I am happy but seems wrong and of course single view check is gone.
Just like you do in content-archive.php
<?php themeblvd_blog_meta(); ?>
Anyway, below is what I am used to and why I will keep testing get_template magic until I get it. I like template idea better. This works for JumpStart, logic is the same I guess. “themeblvd_blog_meta” is like a “on top of each post” kind of hook, is now 🙂
add_action( 'themeblvd_blog_meta', 'post_format_remove_elements', 1 ); function post_format_remove_elements() { if( !current_theme_supports( 'post-formats' ) ) return; switch ( get_post_format() ) { case 'link': remove_action( 'themeblvd_blog_meta', 'themeblvd_blog_meta_default' ); remove_action( 'themeblvd_blog_tags', 'themeblvd_blog_tags_default' ); break; default: // What ever is removed must be inserted again for std.post format add_action( 'themeblvd_blog_meta', 'themeblvd_blog_meta_default' ); add_action( 'themeblvd_blog_tags', 'themeblvd_blog_tags_default' ); break; } }
December 24, 2012 at 6:04 am #1724karlo
ParticipantUpdate which might make you puke but too bad 🙂
I put this in content-link.php, content-gallery.php etc. etc. – and content.php
<?php if (is_single()) { if( themeblvd_get_att( 'show_meta' ) ) : themeblvd_blog_meta(); endif; } else { themeblvd_blog_meta(); } ?>
Then single view meta settings per “post options” are working and a loop like static blog page show meta info per each content-xxx.php file.
Btw and off-topic again, you know about Crayon Syntax Highlighter http://wordpress.org/extend/plugins/crayon-syntax-highlighter/ ? Is amazing and lately got some nice speed tweaks. Point is it supports BBpress 🙂 I have not tested on BBpress but it sure kick butt on normal WordPress. Is on the heavy side, complex, but can be tuned. Very good developer too. I struggle with formatting and pre wrapping is not helping, heh. In case you take requests this is one.
-
AuthorReplies
- You must be logged in to reply to this topic.