-
You have probably been asked this millions of times but where the follow and following buttons are I want to add a couple of extra buttons in the same way and style simply how can I achieve this please posting examples where possible. Many thanks in advance!
@Gaz Lloyd BSc Hons ,
Your Puchase code seems to be invalid.
Can you please verify your purchase as mentioned in the Support Forum Instructions please ? Thank you.
How To:
1. open http://userproplugin.com/userpro/profile/edit/
2. copy & paste your purchase code into the “Envato Purchase Code” field
3. click on “Save Changes”Code added as requested and my original question was You have probably been asked this millions of times but where the follow and following buttons are I want to add a couple of extra buttons in the same way and style simply how can I achieve this please posting examples where possible. Many thanks in advance!
@Gaz Lloyd BSc Hons ,
To add buttons where the followers and following buttons are , you have to add code int the following mentioned file -userpro/addons/social/functions/hooks-actions.php
line no 40 where you find a div class userpro-sc-bar , in that div class you can add what buttons you need.
Please let me how can I help you further.@Gaz Lloyd BSc Hons ,
To add buttons where the followers and following buttons are , you have to add code in the following mentioned file -userpro/addons/social/functions/hooks-actions.phpjust add this following line after
<a href="<?php echo $userpro->permalink($user_id, 'followers', 'userpro_sc_pages'); ?>" class="userpro-count-link"><?php echo $userpro_social->followers_count( $user_id ); ?></a>
add the below one and it will work
(a target=”_blank” href=”http://thevaperooms.com/deposit” class=”userpro-count-link”)Make a Deposit(/a)`please replace ( by < and ) by >
In response to your support reply thank you. However the code didn’t work as expected however I managed to use it as a good starting point.
I followed it as requested and it failed. Can’t say for sure why however it placed a text link but not as the same formatting as the other buttons.
Using you code I managed to edit it to display the links as per the following and follow style with the added extras of icons. For informational purposes I managed the edit using the MX premium wordpress theme however the theme doesn’t affect the plugin file edits.
The code I edited and added was:
<a href="http://thevaperooms.com/deposit" class="userpro-count-link"><i class="fa fa-money"></i><?php echo "Pay Deposit";( $user_id ); ?></a>
An example of how this works is:
If you would like to use this code use this edited version suitable for most:
For themes with icons:
<a href="http://www.yourdomain.com" class="userpro-count-link"><i class="fa fa-money"></i><?php echo "Link Text";( $user_id ); ?></a>
Edit: yourdomain.com with your url link and then edit ‘Link Text’ with the text you want for a link (what the end users see). You need to futher edit “fa fa-money” with your icon shortcode.
For themes without icons:
<a href="http://www.yourdomain.com" class="userpro-count-link"><?php echo "Link Text";( $user_id ); ?></a>
Edit: yourdomain.com with your url link and then edit ‘Link Text’ with the text you want for a link (what the end users see).
Well there you go all fixed and I have included this little demonstration/tutorial as hopefully this helps others in this position.
Many thanks for all your support.
Regards,
Gaz
In follow up to my previous post concerning the solution and instructional for buttons I quickly realised that in fact these buttons would display both to logged in and logged out users. For most this most probably won’t be an issue. However depending and in my case this would be a major issue.
I would just like to take the time out to update my previous instructional with a quick solution to remedy this issue. The code itself remains the same however there has to be a few minor changes.
The Code changes that are required:
A) A php echo do_shortcode statement
B) Moving the text locations for link textTo add buttons where the followers and following buttons are , you have to add code n the following mentioned file ‘userpro/addons/social/functions/hooks-actions.php’
line no 40 where you find a div class userpro-sc-bar , in that div class you can add what buttons you need.Just add this following line after:
<a href="<?php echo $userpro->permalink($user_id, 'followers', 'userpro_sc_pages'); ?>" class="userpro-count-link"><?php echo $userpro_social->followers_count( $user_id ); ?></a>
please replace ( by < and ) by >
The code itself:
<?php echo do_shortcode('[userpro_loggedin] <a href="http://thevaperooms.com/deposit" class="userpro-count-link"><i class="fa fa-check-square"></i><?php echo "Membership Certification";( $user_id ); ?>Membership Certification</a> [/userpro_loggedin]'); ?>
If you would like to use this code use this edited version suitable for most:
The basic check for users of userpro that are logged in:
<?php echo do_shortcode('[userpro_loggedin] CODE HERE [/userpro_loggedin]'); ?>
Edit: Replace CODE HERE with your code.
A coding example for reference for themes with icons:
<?php echo do_shortcode('[userpro_loggedin] <a href="http://yourdomain.com" class="userpro-count-link"><i class="fa fa-check-square"></i><?php echo "Link Text";( $user_id ); ?>Link Text</a> [/userpro_loggedin]'); ?>
Edit: yourdomain.com with your url link and then edit ‘Link Text’ with the text you want for a link (what the end users see). You need to futher edit “fa fa-money” with your icon shortcode.
A coding example for reference for themes without icons:
<?php echo do_shortcode('[userpro_loggedin] <a href="http://yourdomain.com" class="userpro-count-link"><?php echo "Link Text";( $user_id ); ?>Link Text</a> [/userpro_loggedin]'); ?>
Edit: yourdomain.com with your url link and then edit ‘Link Text’ with the text you want for a link (what the end users see).
Well there you go all fixed and I have included this little demonstration/tutorial as hopefully this helps others in this position.
The button or buttons should only be available to those who are logged in making use of the fact that profile are viewable and we want non logged in users to not see the buttons if say viewing from the members directory. You can of course add varies buttons in the same way by repeating the code:
Repeat code:
<a href="http://yourdomain.com" class="userpro-count-link"><?php echo "Link Text";( $user_id ); ?>Link Text</a>
EDIT: This is of course an example of what would be your own code you simply need to add it one after the other behind each
</a>
.Many thanks for all your support.
Regards,
Gaz
@UserPro Support Team, sticky this post to help other please in same position. Thought it would help out!
Regards & thanks,
Gaz
Thanks again Gaz! I don’t need this particular solution right now but may in the future!
You must be logged in to reply to this topic.