Datafeedr Support Forums  

Go Back   Datafeedr Support Forums > Current Version (V3) Forum > Questions
Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Important - The support forums are now in "read-only" mode as we transition to an alternative help desk solution. Feel free to contact us here with any of your questions or search the forums for an existing solution.
 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 24th, 2011, 12:46 AM
globalnet globalnet is offline
 
Join Date: Mar 2011
Posts: 16
Default How do assign a Custom Field to a Category?

Here's what I need to do:

If Category One, then apply this custom field name/value
If Category Two, then apply this custom field name/value

I believe I have the if statement figured out, just need to know how to assign a Custom Field Name and Value:

Code:
<?php if ($category->slug=='category-one') { ?>
Custom Field Name and Value
<?php } elseif ($category->slug=='category-two')  { ?>
Custom Field Name and Value
<?php } ?>
Any ideas?
  #2  
Old March 24th, 2011, 09:09 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

What Custom Field name/value are you referring to? There's nothing like that in Datafeedr.
  #3  
Old March 24th, 2011, 09:52 AM
globalnet globalnet is offline
 
Join Date: Mar 2011
Posts: 16
Default

From wordpress:
Quote:
Custom fields can be used to add extra metadata to a post that you can use in your theme
Wordpress docs: http://codex.wordpress.org/Custom_Fields

I've been adding them directly on the wordpress posts/pages but since Datafeedr creates custom pages there's no such screen.
  #4  
Old March 24th, 2011, 09:57 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

I don't think it's possible to assign a custom field to products in your store. Custom fields require a Post ID or Page ID. A product has neither a Post or Page ID.
  #5  
Old March 24th, 2011, 10:13 AM
globalnet globalnet is offline
 
Join Date: Mar 2011
Posts: 16
Default

Would this also apply to categories?
  #6  
Old March 24th, 2011, 10:16 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Yes, because Datafeedr does not rely on WP Categories, Posts or Pages.

But, you can still do what you want, you'll just need to add the content manually.

Code:
<?php if ($category->slug=='category-one') { ?>
Something here

<?php } elseif ($category->slug=='category-two')  { ?>
Something else here.

<?php } ?>
  #7  
Old March 24th, 2011, 10:55 AM
globalnet globalnet is offline
 
Join Date: Mar 2011
Posts: 16
Default

Then how would I set this up for the custom fields:

'meta_key' - The name of the 'key'.
'meta_value' - The value associated with the key.

Let's say the meta_key is: MyKey

and meta_value is: MyValue


Thanks.
  #8  
Old March 24th, 2011, 11:07 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

That's not possible because in order to store and retrieve meta info, the meta info must be associated with a Post.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom text field for category also on sub pages? lbuilta59 Questions 8 February 7th, 2011 12:59 PM
Assign Custom View to More Than 1 category? sgalusha Questions 1 January 18th, 2011 04:41 PM


All times are GMT -5. The time now is 01:10 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.