Community Forums › Forums › Archived Forums › General Discussion › Create Custom Sidebar with Custom Fields?
Tagged: Custom fields, Custom Post Type, portfolio
- This topic has 10 replies, 2 voices, and was last updated 11 years, 9 months ago by
Brad Dalton.
-
AuthorPosts
-
July 27, 2013 at 3:05 am #52747
ganee
MemberI need some direction on what is the best way to do accomplish this task.
I have a portfolio page which is pulling content from Post type.
On the sidebar on this single post page, I would like to create a custom sidebar that will display project information.
Question:
1. Do I use custom fields to populate the new fields such as Project Name, Project Duration, Client Name?
2. How do I identify this Post is part of portfolio and display the custom side bar?
3. How do I go about to create the sidebar in this case? Can Simple SideBar plugin help?
WP Developer @ Press9
July 27, 2013 at 6:30 pm #52887Brad Dalton
ParticipantJuly 27, 2013 at 9:38 pm #52910ganee
MemberBy using Genensis Simple Sidebars will create the sidebar, however the content in the sidebar will have to be unique for each project being displayed. I am stuck at that part. My assumption is using Custom Fields and somehow pulling the content from the content meta.
I am looking at this example - http://dreamwhisperdesigns.com/genesis-tutorials/load-sidebar-specific-pages/. Do let me know if there is an easier way to do this?
WP Developer @ Press9
July 27, 2013 at 9:43 pm #52912Brad Dalton
ParticipantYeah do that if you want however you may not need to because its a walk in the park creating multiple custom sidebars which you can populate using any widgets. Really depends on your needs.
How many projects?
Custom fields are a step above custom widgets however you will need the code written for each one.
July 27, 2013 at 10:13 pm #52915ganee
MemberThe projects will increase over time and I will keep adding as it comes. By using Genesis Simple Sidebar, I will have the project sidebar option within the post.
If I reading right, your suggestion is to create multiple sidebar and tied with with the relevant Post. Ideally I would like to have only one sidebar and have it dynamically pull the values associated with the Post.
I will have a look at Custom Widgets if its doable here.
WP Developer @ Press9
July 27, 2013 at 10:53 pm #52917Brad Dalton
ParticipantIn that case, custom fields and meta boxes are the way to go and you can use different plugins to help you create them like Advanced Custom Fields (ACF), Pippins custom content types and Types & Views.
July 27, 2013 at 11:10 pm #52919July 29, 2013 at 10:45 am #53080ganee
MemberThanks Brad. I accomplished the task using Genesis Simple SideBar, Advanced Custom Fields and PHP Code plugin.
I created the sidebar using GSS and the custom fields with ACF. On the sidebar widget, I used PHP Code plugin to pull the values from the custom fields using ACF codes.
WP Developer @ Press9
July 29, 2013 at 6:47 pm #53146Brad Dalton
ParticipantWhat PHP code did you use to create the custom field and which PHP code plugin did you use? Please share.
July 30, 2013 at 3:27 am #53180ganee
MemberOh, I didn't create any PHP code to create the custom fields. Perhaps I can detail down below.
1. I used Genesis Simple Sidebar plugin to create a side bar called Works.
2. I then used as per your suggestion Advance Custom Fields and created several fields.
3. I then installed PHP Code Widget (http://wordpress.org/plugins/php-code-widget/).
4. Using the code example given in (http://www.advancedcustomfields.com/resources/getting-started/code-examples/), I inserted those code into the Works sidebar widget using PHP Code Widget. See the image below.
5. The end result would be like this -> http://www.gds.my/smart-arts/It might not be the best solution, but it works. Any suggestion on improvement is much welcomed.
WP Developer @ Press9
July 30, 2013 at 3:53 am #53189Brad Dalton
Participant -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.