Deprecated: Assigning the return value of new by reference is deprecated in /nfs/c03/h06/mnt/47169/domains/themehybrid.com/html/community/bb-settings.php on line 186

Deprecated: Assigning the return value of new by reference is deprecated in /nfs/c03/h06/mnt/47169/domains/themehybrid.com/html/community/bb-includes/backpress/functions.wp-object-cache.php on line 108

Deprecated: Assigning the return value of new by reference is deprecated in /nfs/c03/h06/mnt/47169/domains/themehybrid.com/html/community/bb-includes/backpress/pomo/mo.php on line 171

Deprecated: Assigning the return value of new by reference is deprecated in /nfs/c03/h06/mnt/47169/domains/themehybrid.com/html/community/bb-includes/functions.bb-l10n.php on line 484

Deprecated: Assigning the return value of new by reference is deprecated in /nfs/c03/h06/mnt/47169/domains/themehybrid.com/html/community/bb-includes/backpress/class.wp-taxonomy.php on line 581
Custom byline and post meta functions (Hybrid) « Community

Welcome, guest!

Feel free to read the blog, browse for themes, or join the club.

The community forums are currently being phased out. At the end of February or early March 2012, you will no longer be able to post here. This is because the entire site is being restructured. Please use the main forums for discussions.

Custom byline and post meta functions (Hybrid)

  1. For those of us that want to customize the byline and post meta that appears with each post, how about making them custom functions that can be called?

    I made a couple of templates for a child theme to have something like this:

    <p class="byline">	
    
    <?php custom_byline(); ?> 
    
    <?php edit_post_link(__('Edit','hybrid'), ' <span class="separator">|</span> <span class="edit">', '</span> '); ?>
    
    </p>

    It would be nice if the framework allowed for custom bylines and post metas right out of the box.

  2. It's something I've been considering. I would've done it to start with but wanted to see if it would be better to just use WP 2.7's template-overriding feature. The major problem with making them filterable is that it would be pretty tough for novice users to customize the areas.

    However, I am using some more up-to-date functions in version 0.4 (due out soon) that should make it easier to transition in maybe version 0.5.

    I would say that it's good practice to start using a custom function for them though. I can see this as a definite possibility.

  3. Do you think it would be better to include the <p class="byline"> or the <p class="post-meta-data"> inside the function or within the template files?

    Including it in the function makes it easier to remove the section altogether. Including it in the template files makes less work when filtering it with a custom function.

  4. I'm not quite sure. I ended up putting the <p class=""> tags in the function file of my child themes and forming the byline and post meta data with familiar HTML and WP functions. For me, this is far more intuitive than using filters.

    However, if you are going to filter the byline and post meta data with a custom function, then I would say that the <p class=""> tags should be in the template files. Anything that can be done to make the filtering simpler will make it easier for amateurs like myself to understand.

  5. What I'm really thinking about doing is creating a couple of hooks — one before posts and one after posts.

    Example:

    <div class="<?php hybrid_post_class(); ?>">
    
    	<?php hybrid_before_entry(); // New before entry hook ?>
    
    	<div class="entry-content">
    		<?php the_content(); ?>
    	</div>
    
    	<?php hybrid_after_entry(); // New after entry hook ?>
    
    </div>

    Then, it would be easy to hook a post title, byline, and post metadata wherever you want. Then, I would also make a couple of filterable functions like:

    hybrid_entry_title() // Would display the post title
    
    hybrid_byline() // Would display the byline
    
    hybrid_entry_meta() // Would display the post metadata

    Each one of those would be filterable. Plus, you could add them anywhere you want. For example, you could put the post title at the end of the post if you wanted to (OK, not a great example).

  6. Oh yes please -- a hook after the post where all the post-meta stuff could go, that would be fantastic. As would one before, for the byline.

    The post-meta hook would solve a lot of problems on how to place things like subscribe/email and 'similar posts' and allow them to be formatted as a unit.

  7. Any word on the possibility of implementing this?

  8. It was implemented in version 0.5.

  9. I am interested in using the byline on some posts and hiding it for other posts. I want to include author and date on blog posts, but I would like to leave that information off on portfolio posts.

    I am using Hybrid 0.8 and the Outline theme.

Reply

You must log in to post.

Topic Info