No its not possible as the sidebar on the portfolio item main page is not registered as a sidebar. It therefore does not appear as an option in appearance \ widget area.
add_action('salient_portfolio_hook_single_before_content','salient_porfolio_custom_global_section',1);
function salient_porfolio_custom_global_section() {
echo do_shortcode('[nectar_global_section id="YOUR_GLOBAL_SECTION_ID"]');
}
We are assuming you are familiar with the code and how it works and you can modify it to what you need. Add it to the functions.php file and modify the shortcode to point to the global section you are going to make for the portfolio page.
Hi! there is a way to display a specific widget in portfolio sidebar, instead of the content section?
Hi there,
No its not possible as the sidebar on the portfolio item main page is not registered as a sidebar.
It therefore does not appear as an option in appearance \ widget area.
Cheers.
Hi andrew! thank you for the fast response!
Okay, I got it, I'll try to figure it out in another way.
About that: is there a way to show, using function.php code, a global section in ALL of single portfolio main content?
I did something similar for the product page, as you can see here, but I can't find the product hook
Thank you
Hi there,
You can register a sidebar similar to the ones in:
wp-content\themes\salient\nectar\helpers\widget-related.php the nectar_register_widget_areas function at line 20
When you register it then it should show under appearance \ widgets as a regular widget area.
Then show the sidebar in:
wp-content\plugins\salient-portfolio\includes\frontend\partials\sidebar.php sidebar starts at line 31
Try that as another workaround.
Cheers.
I don't think that this is the solution I was looking for.
I'm trying to give a standard structure to all portfolio, and I want to use global section to do that, not a widget.
I was wondering if there is a way to add with a php function placed in function.php a global section inside the main-content in all portfolio pages.
I switched to the Full Width Page Builder Layout because I found out that the Basic With Sidebar Layout do not fit my necessities.
Thank you
Hi there,
Yes it's possible.
There is a hook for the portfolio pages that is:
do_action( 'salient_portfolio_hook_single_before_content' );
called in:
wp-content\plugins\salient-portfolio\includes\frontend\single-portfolio.php line 104
For a similar solution to https://themenectar.ticksy.com/ticket/2888361/ then use code that looks like this:
We are assuming you are familiar with the code and how it works and you can modify it to what you need.
Add it to the functions.php file and modify the shortcode to point to the global section you are going to make for the portfolio page.
Try that.
It works perfectly!
Thank you very much Andrew!
Have a nice day