July 3, 2014 at 12:49 am 22804 |
Sekander Badsha | Hello
I am have some issues. I am attempting to add 2 a link to the seller dashboard.
I used the following code, but I am not seeing anything. I placed this code in the on dokan/includes/template-tags.php on line 345., I placed these files in my child theme. I would like these links in the top right sellers dashboard and the left dashboard on sellers page. Thank you for help
'settings' => array(
'title' => __( 'Help Files', 'dokan'),
'icon' => '',
'url' => dokan_get_page_url( 'help-files' )
),
'settings' => array(
'title' => __( 'Google', 'dokan'),
'icon' => '',
'url' => dokan_get_page_url( 'http://www.google.com' )
),
Please advise if this is correct. |
July 3, 2014 at 1:25 am 22806 |
Sk
| Hello Jamie,
Nice try. You can use this filter dokan_get_dashboard_nav in dokan/includes/template-tags.php on line 345 to do so. You don’t need to include the file to your child theme. Just use add_filter in your child-theme child-theme/function.php .
write the following code in child-theme/function.php .
add_filter( 'dokan_get_dashboard_nav', 'dokan_e_add_seller_nav' );
function dokan_e_add_seller_nav( $urls ) {
$urls['help'] => array(
'title' => __( 'Help Files', 'dokan'),
'icon' => '<i class="fa fa-users"></i>',
'url' => 'http://www.help.com'
),
$urls['google'] => array(
'title' => __( 'Google', 'dokan'),
'icon' => '<i class="fa fa-google"></i>',
'url' => 'http://www.google.com'
),
}
thank you. 🙂
|
July 3, 2014 at 2:47 am 22816 |
Jamie
| Thank you for helping. I wanna make sure I understand the solution.
1. I place dokan_get_dashboard_nav on line 345 in the [dokan/includes/template-tags.php] file.
**now will this be erased if the file is updated? That is why i included the [dokan/includes/template-tags.php] in my child theme. Do I add parentheses around dokan_get_dashboard_nav?
2. I placed the code below on line 68 of my child theme/functions.php
add_filter( ‘dokan_get_dashboard_nav’, ‘dokan_e_add_seller_nav’ );
function dokan_e_add_seller_nav( $urls ) {
$urls[‘help’] => array(
‘title’ => __( ‘Help Files’, ‘dokan’),
‘icon’ => ‘‘,
‘url’ => ‘http://www.help.com’
),
$urls[‘google’] => array(
‘title’ => __( ‘Google’, ‘dokan’),
‘icon’ => ‘‘,
‘url’ => ‘http://www.google.com’
),
}
I did everything listed above and I got a error.
Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home3/jlpride1/public_html/LOWPRICEOUTLET.COM/wp-content/themes/wedevs-dokan-child/functions.php on line 68
|
July 3, 2014 at 10:07 am 22827 |
Sk
| 1. Do not change or edit dokan/includes/template-tags.php file. You dont need to include this file in your child-theme either.
2.please remove those code from child-theme/function.php and try the following
add_filter( 'dokan_get_dashboard_nav', 'dokan_e_add_seller_nav' );
function dokan_e_add_seller_nav( $urls ) {
$urls['help'] = array(
'title' => __( 'Help Files', 'dokan'),
'icon' => '<i class="fa fa-users"></i>',
'url' => 'http://www.help.com'
);
$urls['google'] = array(
'title' => __( 'Google', 'dokan'),
'icon' => '<i class="fa fa-google-plus"></i>',
'url' => 'http://www.google.com'
);
return $urls;
}
Hope this will work. 🙂
|
July 3, 2014 at 11:22 am 22833 |
Jamie
| Thank you it worked perfect.
|
July 3, 2014 at 11:42 am 22834 |
Jamie
| I forget to ask how do you make the links open to a new window is possible.
Thanks again for all your help
|
July 3, 2014 at 12:19 pm 22835 |
Sk
| Sorry that’s not possible up to this version.
|
October 1, 2014 at 11:47 pm 27866 |
Jamie
| Hello,
I would like to know how do you add the additional links to the dashboard since it is now a plugin? Is there a way of adding this where it will not be deleted with the next update?
Thank you.
|
October 12, 2014 at 1:29 pm 28198 |
Sk
| Hi Jamie,
The same code should work perfectly.
[php]
add_filter( ‘dokan_get_dashboard_nav’, ‘dokan_e_add_seller_nav’ );
function dokan_e_add_seller_nav( $urls ) {
$urls[‘help’] = array(
‘title’ => __( ‘Help Files’, ‘dokan’),
‘icon’ => ‘<i class="fa fa-users"></i>’,
‘url’ => ‘http://www.help.com’
);
$urls[‘google’] = array(
‘title’ => __( ‘Google’, ‘dokan’),
‘icon’ => ‘<i class="fa fa-google-plus"></i>’,
‘url’ => ‘http://www.google.com’
);
return $urls;
}
[/php]
Thank you
|
October 12, 2014 at 5:07 pm 28219 |
Sekander Badsha
| To be safe from loosing your modifications, do no edit a theme or plugin file. Always use a child theme to customize. Here is the official documentation of WordPress about creating and using child themes http://codex.wordpress.org/Child_Themes
|