Skip to content

Conversation

@81jumpstr
Copy link
Owner

No description provided.

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 );
Copy link
Collaborator

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.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meaning;

  1. 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?

Copy link
Collaborator

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 );
}
Copy link
Collaborator

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.

Copy link
Owner Author

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);
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants