Add costume button on profile headers named “Book now”
I want to add a “BOOK NOW” button on header of members profile in buddypress. When clicked, user redirect to another page contains a booking form mentioned booked user ID at top of the form. Buddypress send reservation emails to the both users and admin after form submission.
is it possible?
There’s a variety of ways to achieve this, one way is to overload the BP Template profile header template file. It’s located in
plugins/buddypress/bp-templates/bp-noveau(or bp-legacy)/buddypress/members/single/cover-image-header.phpassuming you are using profile cover images.
This file constructs the members header, if you copy it to
themes/your-theme/buddypress/members/single/cover-image-header.phpyou can edit it and insert a button in there.
Dear @venutius thanks your reply
I did your suggestion but it did not work, my wordpress is 4.9.6 and buddypress is 3.1.0
What code are you using? put it between ` backticks to have it format properly.
<input type=”button” value=”Book now” onclick=”window.location.href=’#” />
Where did you put it? could you include the code that it was inserted into?
Dear @venutius please describe me detailed, I am beginner in wordpress and codex
I think as a first try I’d insert it here:
<?php bp_nouveau_member_header_buttons( array( 'container' => 'ul', 'button_element' => 'button', 'container_classes' => array( 'member-header-actions' ), ) ); ?><form> <input type=”button” value=”Book now” onclick=”window.location.href=’#” /> </form> <?php bp_nouveau_member_hook( 'before', 'header_meta' ); ?> <?php if ( bp_nouveau_member_has_meta() ) : ?> <div class="item-meta">
in which php file I should add this code?
Do this code mention booked user ID at top of the form?
Might be wise to confirm with you which bp theme you have in dashboard>>settings>>buddypress>>options ? are you running Nouveau?
my bp them is sweetdate
The selected Template Pack will serve all BuddyPress templates running buddypress Nouveau
This might not work then, Sweetdate may have overloaded the cover-image-header already, you will probably need to ask them about overloading.
- You must be logged in to reply to this topic.