Support » Plugin: Events Manager » Copy button look

  • Hi,

    On my “My Events” page where people can edit/delete their events and also add a new one, I would like my “Add New” button to look like the “Search Events” button.

    Right now the code for the Search Events button is:
    <input type="submit" value="<?php _e('Search Events','events-manager'); ?>" class="button" />

    And for my Add New button is:

    <?php
    			echo $EM_Notices;
    			if(!empty($show_add_new) && current_user_can('edit_events')) echo '<a class="em-button button add-new-h2" href="'.em_add_get_params($_SERVER['REQUEST_URI'],array('action'=>'edit','scope'=>null,'status'=>null,'event_id'=>null, 'success'=>null)).'">'.__('Add New','events-manager').'</a>';
    		?>

    So again, I want my Add New button to look like my Search Events button.

    How can I do it?

    Thanks 🙂

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    you can modify template file at events-manager/templates/tables/events.php

    to use templates: http://wp-events-plugin.com/documentation/using-template-files/

    eg. wp-content/themes/Your Theme/plugins/events-manager/tables/events.php

    Patrick

    (@duisterdenhaag)

    Try this:

    <?php
    echo $EM_Notices;
    if(!empty($show_add_new) && current_user_can('edit_events'))  {
    	$url = em_add_get_params($_SERVER['REQUEST_URI'],array('action'=>'edit','scope'=>null,'status'=>null,'event_id'=>null, 'success'=>null));
    	echo '<a href="'.$url.'"><button type="button" value="'. __('Add New','events-manager') .'" class="button" /></a>';
    ?>
    • This reply was modified 3 months, 3 weeks ago by  Patrick.

    Yes, that’s the file I got that code from…
    I just don’t know how the code is supposed to look like, as I’m not a developer myself. I can make some obvious changes, but in this case it’s just too complicated. I tried one approach that I thought it was obvious, but it didn’t come up as expected :/

    Do you know how the code is supposed to be, according to those 2 pieces of code I shared?

    Thank you! 🙂

    Patrick:

    I tried it, but it completely broke the page… I can only see the page’s title and the top menu when I paste that code you provided 🙁

    Patrick

    (@duisterdenhaag)

    OOPS! I forgot the last }

    Try it now:

    <?php
    echo $EM_Notices;
    if(!empty($show_add_new) && current_user_can('edit_events'))  {
    	$url = em_add_get_params($_SERVER['REQUEST_URI'],array('action'=>'edit','scope'=>null,'status'=>null,'event_id'=>null, 'success'=>null));
    	echo '<a href="'.$url.'"><button type="button" value="'. __('Add New','events-manager') .'" class="button" /></a>';
    }
    ?>

    No luck… 🙁

    This is what I have originally:
    https://snag.gy/JcK5Wg.jpg

    This is what I get after using your code:
    https://snag.gy/oOP3ek.jpg

    Do you think I’m pasting it in the wrong place or something?
    I moved it to the original place and it gets weird as well, so it’s not the place itself… 🙁

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