Tagged: child theme, enfold
-
AuthorPosts
-
February 16, 2014 at 1:46 pm #224521
Hi!
I like to post my tweets as a blog post. The currently available post formats “link”, “quote” doesn’t fit.
How can i add a new post format “tweet” to an enfold-child theme ?
Regards,
Fox- This topic was modified 10 years, 9 months ago by flinkfoxxx.
February 17, 2014 at 6:17 am #224776Hi flinkfoxxx!
You can edit functions.php, find this code on line 443:
add_theme_support( 'post-formats', array('link', 'quote', 'gallery','video','image','audio' ) );
Replace it with:
add_theme_support( 'post-formats', array('link', 'quote', 'gallery','video','image','audio','status' ) );
We used the status post format. You can refer to this link: http://codex.wordpress.org/Post_Formats#Supported_Formats
You can edit the status format using this on functions.php:
add_filter( 'post-format-status', 'avia_status_content_filter', 10, 1 ); if(!function_exists('avia_status_content_filter')) { function avia_status_content_filter($current_post) { /* FUNCTION HERE */ } }
Best regards,
IsmaelFebruary 17, 2014 at 10:21 am #224856Hi Ismael,
thanks for your reply. With these changes i get some warnings from font-manager.class.php (622); because the icon for status is not defined.
Is enfold supporting get_template_part( ‘content’, get_post_format() ); ?
I think this would make some changes a lot easier.Kind regards,
FoxFebruary 17, 2014 at 10:52 am #224882Hi!
Insert this code into the functions.php file:
add_filter('avf_default_icons','avia_add_custom_icon', 10, 1); function avia_add_custom_icon($icons) { $icons['status'] = array( 'font' =>'social-fontello', 'icon' => 'ue803'); return $icons; }
to register a new icon. Replace the icon and font values if necessary.
Is enfold supporting get_template_part( ‘content’, get_post_format() ); ?
No, because Kriesi uses a filter to change the post format layout and does not load different templates. For all available filter see: wp-content/themes/enfold/includes/helper-post-format.php
Best regards,
PeterFebruary 17, 2014 at 10:59 am #224887Hi Peter,
thanks for the fast reply and the code fragment.
Could you please explain why enfold doesn’t support get_template_part() and instead uses filter. What is the advantage ?
Kind Regards,
FoxFebruary 18, 2014 at 6:37 am #225343Hi!
Its just a different way of loading in the templates that allows for more code to be reused and all of the post formats to be in the single file.
Best regards,
DevinFebruary 18, 2014 at 9:11 am #225377Hi Devin,
thank you for your answer. I think this way it is harder for your customers to adapt the theme. I would realy like to see support for get_template_part() and the post-format ‘status’ and ‘chat’. Thank you ;-)Best regards,
FoxxFebruary 18, 2014 at 2:47 pm #225496Hi!
Please hire a freelance developer if you want to use the get_template_part() function instead of the post formats filters that are being use within the theme. Visit Werkpress for customizations.
Cheers!
IsmaelFebruary 18, 2014 at 3:22 pm #225509Hi Ismael,
i am a freelance developer
i like coding standards
i like standard wordpress functions
i like KISS*bigsmile* ;-)
Kind regards,
FoxxFebruary 18, 2014 at 10:27 pm #225784Just for anyone visiting this later on and for clarity the theme uses get_template_part for grabbing code when needed. For the post formats its just easier and Keeps It Simple by having them all in one file where they can be edited quickly and easily. Instead of having half a dozen files with repeating code Kriesi is able to reuse much larger portions of code and functions while keeping post formats intact.
There will be no point where it will change to use content-$posttype for Enfold but if you want to change it you definitely could.
-
AuthorPosts
- The topic ‘How to add new post format ?’ is closed to new replies.