Tagged: x
-
AuthorPosts
-
June 3, 2016 at 8:48 pm #1025103
vendinimarketingParticipantHi!
I’m wondering if there’s a way to add content inputs to the “Portfolio Item” pages? The ability to set a custom project link for each item is great and I would really like to be able to do that with the rest of the sidebar area.
Specifically, I need to edit the Launch Project h2 text and the CTA button text for each item. I know I can edit these for all item pages in the “Customize” area, but some CTAs lead to videos or .pdf downloads or other types of resources and one global CTA doesn’t work for all cases.
An example of one of my item pages: http://vendini.com/resources/the-villages-entertainment
Is there a way to edit the template’s php to add more editable fields? I’ve included a screenshot of where I would like these fields to appear.
Thanks so much for any direction you can give!
Cheers,
JoanJune 4, 2016 at 4:25 am #1025457
Nabeel AModeratorHi Joan,
Thanks for writing in! Please refer to the following thread https://community.theme.co/forums/topic/portfolio-right-side-customization/
Hope this helps!
June 6, 2016 at 1:10 pm #1028436
vendinimarketingParticipantThanks so much for pointing me to that thread! The ability to add text is awesome.
Is there a way I can edit the text that’s already showing up dynamically? For example, can I create a custom field that would edit the button text of the project link? I’ve set the global button text to be “Get It!”, but if I wanted the button on a specific page to say “Watch It!”, what would the code look like for that?
Thanks!
June 6, 2016 at 10:10 pm #1029194
LelyModeratorHi Joan,
That would need a little more customization. Please add the following code on your child theme’s functions.php file:
// Output Portfolio Item Project Link // ============================================================================= function x_portfolio_item_project_link() { $project_link = get_post_meta( get_the_ID(), '_x_portfolio_project_link', true ); $launch_title = x_get_option( 'x_portfolio_launch_project_title' ); if(is_single(5)){ // Custom Button Text $launch_button = 'Watch it'; }else{ $launch_button = x_get_option( 'x_portfolio_launch_project_button_text' ); } if ( $project_link ) : ?> <h2 class="h-extra launch"><?php echo $launch_title; ?></h2> <a href="<?php echo $project_link; ?>" title="<?php echo $launch_button; ?>" class="x-btn x-btn-block" target="_blank"><?php echo $launch_button; ?></a> <?php endif; }Check this line
if(is_single(5)){from above. Change 5 to your own portfolio ID where you want to use Watch it.Further customizations from here would be getting into custom development, which is outside the scope of support we can offer. If you need more in depth changes, you may wish to consult with a developer. X is quite extensible with child themes, so there are plenty of possibilities. Thanks for understanding.
June 7, 2016 at 6:33 pm #1030856
vendinimarketingParticipantI totally understand about the future customizations and thanks for providing the above code snippet!
I’m having trouble adding it however…when I add it to my child theme’s function.php file, half the time it pulls up the single portfolio page correctly and half the time I get a fatal error message.
The message says “Fatal error: cannot redeclare x_portfolio_item_project_link() (previously declared …/wp-content/themes/x-child/functions.php:176) in /wp-content/x/framework/functions/global/portfolio.php on line 243”
Am I missing something? I removed the code for now as I don’t want people getting an error message half the time. I’ve included a screenshot of the error message below.
Also, is it possible to use a body class of some kind instead of the portfolio ID so I don’t have to adjust the functions.php file every time I add a new portfolio item that needs the alternate text?
Thanks so much!
June 8, 2016 at 5:53 am #1031631
Paul RModeratorHi,
Sorry, the x_portfolio_item_project_link function can’t be overridden in your child theme’s functions.php
You will have to edit the function directly in /wp-content/x/framework/functions/global/portfolio.php
but please note that it will get overwritten on theme update.
With regards body class, it could be possible with custom development, but this would be outside the scope of support we can offer. You may wish to consult a developer to assist you with this. Thanks
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1025103 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
