added meta-fields for infographs...list appeared but seems odd?#58
added meta-fields for infographs...list appeared but seems odd?#5881jumpstr wants to merge 5 commits into
Conversation
| <?php | ||
| add_post_meta( 5 , 'setupshop_interventions_focus' , 'education' , false ); | ||
| add_post_meta( 5 , 'setupshop_interventions_focus' , 'health' , false ); | ||
| add_post_meta( 5 , 'setupshop_interventions_focus' , 'games' , false ); |
There was a problem hiding this comment.
The idea is that you can add your meta fields into the back end, not through code otherwise you're going to have to code each page. So your code at this point looks just fine but it's not solving your problem.
There was a problem hiding this comment.
Meaning;
- for the post_id, instead of the wp-id (i.e "5"), should call by action tag, the_ID() ...or are all the parameters supposed to be generic and substituted with names only where and when needed?
There was a problem hiding this comment.
There's no point in adding post meta programmatically if you're going to call it 2 lines down. The whole idea is that this data is filled out in the wp-admin when you add a post.
| add_post_meta( the_ID() , 'setupshop_interventions_focus' , 'education' , false ); | ||
| add_post_meta( the_ID() , 'setupshop_interventions_focus' , 'health' , false ); | ||
| add_post_meta( the_ID() , 'setupshop_interventions_focus' , 'games' , false ); | ||
| } |
There was a problem hiding this comment.
As per previous comment. I don't understand why you'd want to do this.
There was a problem hiding this comment.
So, while busy, I was working in functions.php, Matt suggested, since it'll only be needed in the about page, let's put it there.
Do you mean, I completely went the wrong way about it?
| add_post_meta( the_ID() , 'setupshop_interventions_focus' , 'games' , false ); | ||
| } | ||
|
|
||
| $projects_focus = get_post_meta( the_ID() , 'projects_focus' , false); |
There was a problem hiding this comment.
Where is the project_focus being added?
No description provided.