Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Post-Kicker, -Byline & -Footer (http://forum.bytesforall.com/forumdisplay.php?f=17)
-   -   Custom post fields (http://forum.bytesforall.com/showthread.php?t=137)

wwday3 Jan 28, 2009 06:27 PM

Custom post fields
 
I am setting up a network of aggregator blogs using the FeedWordpress plugin. All of the feed and publisher information that FWP provides is stored in the custom post fields.

Is there a way - using your template "tags" - to extract that custom field information? For instance, what I'd like to do is display a byline something like

Posted by Joe from XYZ blog on January 15, 2009

Normally, to do this, I would just code the FWP template fields inside the index.php or single.php files. I suppose I could do this with your templates as well, but I'd hate to break one and later have my modifications overwritten.

So, can I access the custom fields somehow?

Flynn Jan 29, 2009 04:39 AM

The theme is not prepared to display custom fields. You would have to put the code to retrieve the custom field value somewhere into the theme files. I.e. into bfa_postinfo.php,

somewhere before

PHP Code:

$postinfo $postinfo_string

code like this:

PHP Code:

$from_xyz_blog PHP_CODE TO RETRIEVE THE CUSTOM FIELD VALUE

and somewhere below

PHP Code:

$postinfo $postinfo_string

code like this:

PHP Code:

$postinfo str_replace("%from-xyz-blog%"$from_xyz_blog$postinfo); 


Then you would be able to use %from-xyz-blog% as a postinfo tag at Atahualpa Theme Options -> Post / Page Info Items

Ashjoielee Jan 29, 2009 02:00 PM

I was just about to ask about Custom Fields and saw this thread. I'm not good at php coding, so I want to be sure I'm getting this-

I'm wanting to use the Custom Fields in my sidebar to have this:
Listening to:
Reading:
Event:
(Etc.-I have a list of 5 things)

Can I do this?

Thanks,
Ash

Flynn Jan 29, 2009 02:05 PM

Looks like this widget can do that http://wordpress.org/extend/plugins/...-field-widget/

Ashjoielee Jan 29, 2009 02:43 PM

Thanks Flynn,
I couldn't get that plugin to unzip
I have the 'More Fields' plugin and see the custom fields boxes at the bottom of the write/edit page in site admin.
But the directions say coding needs to be added and I'm not sure where to add it.
http://codex.wordpress.org/Using_Custom_Fields

Flynn Jan 29, 2009 05:58 PM

Quote:

Originally Posted by Ashjoielee (Post 546)
I was just about to ask about Custom Fields and saw this thread. I'm not good at php coding, so I want to be sure I'm getting this-

I'm wanting to use the Custom Fields in my sidebar to have this:
Listening to:
Reading:
Event:
(Etc.-I have a list of 5 things)

Can I do this?

Thanks,
Ash

And that content is going to stay the same throughout the whole site? Because then I don't see why you'd use custom fields at all. Custom fields are supposed to add certain individual content to each post.

ciolo Mar 20, 2009 10:48 AM

i also installed custom fields template, and i modded the bfa_postinfo.php:

Quote:

$infoplus = the_meta();
$postinfo = $postinfo_string;
$postinfo = str_replace("%infoplus%", $infoplus, $postinfo);
This will display the meta info under the title and above de footer (twice) but i want to make a div and put it to float-right in the post and display the info there like this: http://img26.imageshack.us/img26/4982/postwidget.png. Can anyone help ? Thanks.

daniel3ub Jul 27, 2009 06:02 PM

Quote:

Originally Posted by wwday3 (Post 540)
Is there a way - using your template "tags" - to extract that custom field information? For instance, what I'd like to do is display a byline something like

Posted by Joe from XYZ blog on January 15, 2009

You can use the %meta% post info item. Your byline should be something like that:

Code:

Posted by %author-posts-link% from <a href="%meta('syndication_source_uri')%">%meta('syndication_source')%</a> on %date('d#/m#/y')%
I am using it. :)

daniel3ub Jul 28, 2009 11:39 AM

So, I am using the solution above BUT it does not work with posts that are not syndicated, giving me the
Code:

Warning: implode() [function.implode]: Bad arguments. in /var/www/wordpress/wp-content/themes/atahualpa/functions/bfa_postinfo.php on line 16
Any way to avoid this? Is there a way to filter some of the post info according to the category, maybe?


All times are GMT -6. The time now is 04:20 AM.

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