• Resolved oshi

    (@thugzanime)


    Hi, On the archive donation single page it display the title as Donation Forms I would like to change it to Support our Cause instead of donation Forms. I will be using this archive single page as a default template displaying all our donation form.

    I have tried this code it did nothing

    
    add_filter('my-give-archive-title' , 'my_give_archive_title');
    function my_give_archive_title($content) {
    	global $wp_query;
    	if ( 'donation' != $wp_query -> query_vars['donation'] )
    		return $content;
    
    	return '<h1 class="my_custom_class">Support Our CAUSE</h1>';
    }
    
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Ben Meredith

    (@benmeredithgmailcom)

    Hi Oshi,

    With the advent of the Form Grid Shortcode, it’s now really easy and code-free to create an archive page for donation forms, by creating a page and using the [give_form_grid] shortcode.

    You can read more about that here: https://givewp.com/documentation/core/shortcodes/give_form_grid/

    If you want to custom code an archive page, that’s more dependent on the theme than on Give itself. We wrote a tutorial on how to code that here: https://givewp.com/donation-forms-one-page/

    Your code above is attempting to filter the output of a give archive title using the filter my-give-archive-title, but unless you coded that filter into a custom archive page, it’s not doing anything (because it’s accessing a filter that is not there). Give doesn’t create an archive template, so unless your theme does, you’d have to fully create the template following the blog tutorial above.

    We’re excited you’re using and extending Give. Let us know how else we can help.

    Thread Starter oshi

    (@thugzanime)

    Hi Ben Meredith, Thank You once again, Using the short-code [give_form_grid] has solve my problem. Actually the first thing I did was creating the archive single page following Give tutorial link you have shared, Thanks to the shortcode I can easily now customise the page.

    Thank You Ben

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Changing the archive title on donation single page’ is closed to new replies.