Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages » Post-Kicker, -Byline & -Footer »

Need help with "%meta('fieldname')%"


  #1  
Old Apr 14, 2009, 08:53 PM
Antsliedown
 
5 posts · Apr 2009
Though I follow the directions. I can't seem to to display any of my Custom Fields in the footer with the %meta('fieldname')%

Any Help?
  #2  
Old Apr 15, 2009, 08:40 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
A bug it seems, still looking... Thanks for finding
  #3  
Old Apr 15, 2009, 11:52 PM
Antsliedown
 
5 posts · Apr 2009
Thanks for the response. I thought I was losing it. I'll stop banging my head.
  #4  
Old Apr 21, 2009, 01:52 AM
shi
 
5 posts · Apr 2009
London, Canada
I think I found a fix: in functions/bfa_postinfo.php, insert at line 10 (in meta_values()):

global $post;

I was able to use the above code in the theme options page "Post/Page Info Items" to create a byline which only shows if a certain custom field is defined:

<?php global $post; if (get_post_meta($post->ID, 'editor', TRUE)) { ?>
Edited by %meta('editor')%
<?php } ?>

hope this helps; I'd be interested to know if there's a more 'proper' way of fixing this.
  #5  
Old Apr 22, 2009, 07:13 AM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
I replaced the post meta callback function, the second function from top in bfa_postinfo.php, with this

PHP Code:
// Callback function for post meta replacement
function meta_values($matches) {
    
$meta_key $matches[1];
    
// "get_post_custom_values" returns an array. Turn it into a string, separated by commata
    
$meta_values implode(", "get_post_custom_values($meta_key));
    return 
$meta_values;

In case there are several custom fields with the same name, it list them all separated by comma.
  #6  
Old May 2, 2009, 09:43 PM
mkny13
 
14 posts · Apr 2009
Thanks Flynn, your code works. Question--is is possible to make these custom fields link to other posts with the same value? Like tags, but filtered down to one attribute that's being tagged.

For example, I'm putting up posts that contain assignments for classes I've taken. One of my custom fields is the course number that assignment was completed for. When I display that custom field under my post (or wherever), could I make it link all other posts/assignments that share that course number in the coursenumber custom field?

Here's the site I'm looking to apply this to: http://www.valdosta.edu/~makastellec/portfolio/?cat=3

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to post on 2 seperate "Pages" or "Cats" TPR Atahualpa 3 Wordpress theme 18 Aug 4, 2010 09:24 PM
where can I rename "categories" and "Pages" into other titling? curious Atahualpa 3 Wordpress theme 5 Apr 28, 2009 04:15 PM
How to style "post icon" and "post comments" text Whatsthatcat? RSS, Feeds & Subscribing 3 Apr 1, 2009 10:41 AM
Flexx theme - How to change my "List Category or Archives" to "List Titles ONLY" ?? idaks01 Post-Kicker, -Byline & -Footer 0 Mar 28, 2009 06:22 PM
modifying font size of "Today's Events" and "Upcoming Events" in sidebar ritland Forum How-To 0 Mar 16, 2009 04:23 PM


All times are GMT -6. The time now is 12:24 AM.


Powered by vBulletin® Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.