Skip to:
Content
Pages
Categories
Search
Top
Bottom

Add costume button on profile headers named “Book now”


  • ahad77
    Participant

    @ahad77

    Hi
    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?

Viewing 12 replies - 1 through 12 (of 12 total)

  • Venutius
    Moderator

    @venutius

    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.php assuming 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.php you can edit it and insert a button in there.


    ahad77
    Participant

    @ahad77

    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


    Venutius
    Moderator

    @venutius

    What code are you using? put it between ` backticks to have it format properly.


    ahad77
    Participant

    @ahad77

    like below:

    <form>
    <input type=”button” value=”Book now” onclick=”window.location.href=’#” />
    </form>


    Venutius
    Moderator

    @venutius

    Where did you put it? could you include the code that it was inserted into?


    ahad77
    Participant

    @ahad77

    in
    cover-image-header.php

    Dear @venutius please describe me detailed, I am beginner in wordpress and codex


    Venutius
    Moderator

    @venutius

    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">
    

    ahad77
    Participant

    @ahad77

    in which php file I should add this code?
    Do this code mention booked user ID at top of the form?


    Venutius
    Moderator

    @venutius

    Might be wise to confirm with you which bp theme you have in dashboard>>settings>>buddypress>>options ? are you running Nouveau?


    ahad77
    Participant

    @ahad77

    my bp them is sweetdate
    The selected Template Pack will serve all BuddyPress templates running buddypress Nouveau


    Venutius
    Moderator

    @venutius

    This might not work then, Sweetdate may have overloaded the cover-image-header already, you will probably need to ask them about overloading.


    ahad77
    Participant

    @ahad77

    Thank you @venutius
    I hope my issue will be solved!

Viewing 12 replies - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.
Skip to toolbar