Jump to content

Archived

This topic is now archived and is closed to further replies.

vinofanten

How to display values entered in custom fields on single post pages.

Recommended Posts

vinofanten    0
vinofanten

I have a website using the Academy theme based on DMS, and will be posting wine tasting notes on the site.

 
Instead of posting wine tasting notes as orginal posts in Wordpress, I have created a custom post type called "wines_tasting_notes" using the Advanced Custom Post Types plugin in Wordpress. I have also created custom fields for this custom post type (using another plugin), but I can't figure out how to display values I enter in the custom fields in the posts that I upload in this new custom post type.

Now, when I click on a post title in the post loop (on my website), the post opens with, what I believe is, single.php as the template. My question is how can I create a new template for single post in the wine tasting notes CPT, with the standard post type as a base.
 
My second question is how I can display values from my custom fields and like in the image below? Do I have to tweak a .php file, or do I have to create a template in DMS? Or is there a plugin for tweaking the look of a single.php page (e.g. if I create a single-wines.php for wine posts). Or do I have to do this using code?
 
Custom fields in this case are:
- type of wine
- grape variety
- region of production
- etc

 

See attached image.

 

[attachment=1523:wine_tasting_note.png]

 

Hope that someone can help me, as I have googled this issue and found nothing of help. :)

Share this post


Link to post
Share on other sites
vinofanten    0
vinofanten

Here is a screen of the field names used for the custom fields.

 

[attachment=1524:field_names.png]

Share this post


Link to post
Share on other sites
Rob    547
Rob

Hello,

 

Unfortunately, you're using a third-party product as the child theme and we can't support any products made by any other developers.  However, the team at PageLines Academy are very good and will happily support your efforts.

 

As for the second question, I've not tested this, but it appears to be a well-used, popular and well-maintained product that should work with DMS.  http://wordpress.org/plugins/advanced-custom-fields/

 

It would allow you to create the custom fields.  As for displaying them in the child theme, they might be able to assist you more with that as well, if the plugin doesn't integrate.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites

  • Similar Content

    • flourishdesignstudio
      By flourishdesignstudio
      Hi,
      I am using PL5 as well as Advanced Custom Fields (AFC) to help add meta data to individual posts on our blog. However, where I am getting stuck is how to display the meta data on the actual public post page (frontend). For example, if we have posts that have a subject matter of plants then there are custom fields that the client fills out such as "Scientific Name", "Region", etc. I have used ACF before to display this meta data onto the loops section as well as in Revolution Slider or Essential Grid. However, I am not sure if there is a way to have this metadata display on the actual post page. Can you point me in the right direction? I am using a child theme so I wasn't sure if that meant I had to edit the functions.php file or if there was some other workaround that you knew of.
      Thanks so much!
    • PeriniNero
      By PeriniNero+
      We are building a Custom Post Type with Custom Fields and Custom Taxonomies.
      The only thing we dont understand is how to embed the Custom Fields including header tags and stuff in the Postloop (now we use a text-box below the postloop section but also SEO wise this is not best pratice).
      So we thought to copy the dms Postloop section to our child theme and rename this, to add an extra Postloop section to our theme. Is this the way?
      What exactly to adjust in those 3 files class.posts.php, section.php and style.less (at this point we know how to change the thumb LOL) and where to add the Custom Fields shortcodes?
      Thanks.
    • dawsonbarber
      By dawsonbarber+
      I found that I'm unable to create and save custom field groups with WP Types when Single Bits is installed and active.
       
      I'm not sure if it interferes with any other functionality, but there's definitely an issue with custom field groups.
       
      When I deactivate Single Bits, I'm able to create custom field groups.
       
      Custom fields appear to be fully functioning after creating them and reactivating Single Bits, so that's good.
    • CjrMotley
      By CjrMotley+
      Ok, I'm having problems with my custom post types showing on my front blog page along with my regular blog post, here is a link to the custom post type (sample post) ==> http://www.definitiondjs.com/musiclibrary/this-is-a-post-title-test/ ..... my custom fields doesn't show, Why?
       
      Also, when I edit the custom post, all the fields change to blank (the previous text that was in the field is somehow deleted), why?
       
      Wordpress: 4.0
      Pageline Frameworks: 2.4.5
      cpt plugin is: WCK, here is a link to the site ==> http://www.cozmoslabs.com/docs/wordpress-creation-kit-documentation/
       
      I linked snapshots of the custom fields area, which doesnt show after publishing or after clicking edit this post:
       
      http://www.definitiondjs.com/wp-content/uploads/2014/09/01.png
      http://www.definitiondjs.com/wp-content/uploads/2014/09/02.png
      http://www.definitiondjs.com/wp-content/uploads/2014/09/03.png
       
      Summary, I would like my custom post to display on my front page, along with my blog post.
       
      Also I would like to have an option to hide post from showing on front page, but I would like for all posts to show in search, archieved and category, even if hidden from the front page.
       
      Thanks in advance!
    • circ2013
      By circ2013
      Hello Pagelines, I have spent the better part of the day trying to figure out how to set up custom fields within posts where the values can then be displayed on the front end within a PL-nextbox section.
       
      Here is what I am trying to do with no luck thus far.
       
      I have set up custom fields within posts.  For example, I am doing a site for builder.  We want custom fields within each post for Architect, Landscape architect, Interior Designer, Testimonial, Sustainability Features, Date Completed, and Location.  I have set it up so that each label is the key and what ever the client enters is the value.
       
      I would them like to display these fields on the post either within the_content of the post/loop or outside of the content in a PL-Nextbox.
       
      I have tried using the following within the pl-nextbox, but it keeps returning "Looks like your NextBox PHP resulted in an error :/"
      <?php $post->ID = 1446;?>
      <?php echo esc_html(get_post_meta($post->ID, 'project_type', true));?> <?php echo esc_html(get_post_meta($post->ID, 'architect', true));?>   Anyone have any suggestions on how I can pull this off?  Should I add this directly to the sections.php file with DMS>Sections>Postloop>sections.php?   I was hoping to create a left column that would display all the project details in an unordered list with some additional formatting...  Then have the project description (wp_Content/loop) display to the right in a new column, but if I have to create a special template and include my updates within the file, I can give that a shot.   Thanks, Scott  
       
×