-
Notifications
You must be signed in to change notification settings - Fork 0
added meta-fields for infographs...list appeared but seems odd? #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
functions.php
Outdated
| <?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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
page-about.php
Outdated
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per previous comment. I don't understand why you'd want to do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
page-about.php
Outdated
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is the project_focus being added?
No description provided.