-
AuthorPosts
-
September 19, 2013 at 11:48 am #163514
Hi, the following is kind of difficult to explain, so let’s hope I succeed in doing so. What I basically need to do is automatically show certain content felds on my portfolio pages. For example:
I have hundreds of customers which I added in the portfolio section. I’ve added the whole list of customer logo’s on a page. When visitors click on a customer logo to see the customer details page, they get details such as a quote, pictures, downloadable pdf files, and so on. This information is added through the Avia Layout Builder.
BUT, above the content of the Avia Layout Builder, I want to automatically show the following elements, because most customer detail pages will consist ONLY this info and it’s therefore a big timesaver to make this happen automatically:
– Show the customer logo (featured image)
– Show the customer name (page title)
– Show the customer country (assigned category)
– Show the customer website link (custom field added with Simple Fields plugin)On top of that, I’d like to be able to layout it somewhat so that the logo is placed to the left of the title+country+website. I’ve already tried adding some php in the single-portfolio.php file, but my PHP knowledge is very limited and I keep getting errors.
To call for the correct fields, I think it’s something like:
– Featured image: the_post_thumbnail( );
– Page title: the_title( );
– Assigned category: get_the_term_list( get_the_ID() )
– Simple Fields custom field: $customers_website = simple_fields_get_post_value(get_the_id(), array(3, 1), true);Below is an example of the code I’ve put together, which still has an error and seems to replace any content inside the Avia Layout Builder, but as I explained it’s supposed to just show above it.
<?php echo "<div style='float:left; border:1px solid #E1E1E1; margin-right:5%; margin-bottom:20px;'>"; if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it. the_post_thumbnail( ); } echo "</div>"; the_title( '<h3>', '</h3><p>' ); echo strip_tags ( get_the_term_list( get_the_ID(), 'customers_entries' ) ); $customers_website = simple_fields_get_post_value(get_the_id(), array(3, 1), true); echo "</p><p><a href='$customers_website' target='_blank'>$customers_website</a></p>"; ?>
Any advice is greatly appreciated.
Thanks in advance!September 20, 2013 at 12:01 am #163795Hello DavyE!
This is unfortunately quite a bit beyond what we can assist with via support. When our queue is low we’ll sometimes go above and beyond individually to put together a custom layout/solution but in general its best to take something like this to a freelance developer who can spend the needed time putting things together and still be able to support the new customization (since we wouldn’t be able to).
Best regards,
Devin -
AuthorPosts
- The topic ‘Calling for specific fields and show them on the page’ is closed to new replies.