Change wording of "Tickets Remaining"
-
My client would like to change the wording of how many tickets are remaining for purchase, but for the life of me I can’t find where to do it. Suggestions?
-
You’ll probably want to use the ‘mt_tickets_remaining_continuous_text’ filter and this code example: https://github.com/joedolson/plugin-extensions/blob/master/my-tickets/my-tickets-filter-text-noargs.php
Thanks for the fast response Joe!
I took your example code, pasted into the child theme functions.php, and tweaked the wording as suggested:
add_filter( 'mt_tickets_remaining_continuous_text', 'my_tickets_remaining_continuous_text' ); function my_tickets_remaining_continuous_text( $default ) { return "Seats Remaining"; // your custom text }
It replaced the text like I wanted it to, but it doesn’t return the actual number of seats remaining. The integer is missing. How can I bring that back?
You need to include ‘%s’ in the string somewhere, so that that information will get included in the text. E.g. “Seats Remaining: %s”.
Fantastic Joe, that worked. Thanks for helping out a non-programmer!
Having the same problem here but it does not work out.
Just to make a few things clear for me. I used the php with the example and did my changes like:
<?php
/*
Plugin Name: Remaining Tickets Text ?nderung
Plugin URI: https://www.joedolson.com/
Description: Example plug-in demonstrating how to replace text using filters in My Tickets.
Version: 1.0.0
Author: Joseph Dolson
Author URI: https://www.joedolson.com/
*/
/**
* Replace add to cart text using the mt_add_to_cart_text filter
*
* This is an example using the ‘mt_add_to_cart_text’ filter, which replaces the text for the Add to Cart button.
* There are many text filters available in My Tickets beyond this example.
*/
add_filter( ‘mt_tickets_remaining_continuous_text’, ‘mt_tickets_remaining_continuous_text’ );
function mt_tickets_remaining_continuous_text( $default ) {
return “verfügbar: %s”; // your custom text
}I saved this file to my plugins folder and installed it, but there is no change? I would like to change the wording “X/X remaining” at the calender overview to “X/X verfügbar”
SkySurfer, you don’t need to install it as a plugin. Simply add those few lines of code to your functions.php and save.
Hey Bdwatt0,
thanks for your reply. I pasted it inside the functions.php of my template because it is written above, but the end of the story was that the complete site was down :/ So I deleted it.
Would it be possible for you to post that part you included and where you included it? Sorry, I am not neraly a wordpress expert.
SkySurfer78, this is what the beginning of the functions.php looks like for the site I’ve changed the MT wording:
<?php // Exit if accessed directly if ( !defined( 'ABSPATH' ) ) exit; // BEGIN ENQUEUE PARENT ACTION // AUTO GENERATED - Do not modify or remove comment markers above or below: if ( !function_exists( 'chld_thm_cfg_parent_css' ) ): function chld_thm_cfg_parent_css() { wp_enqueue_style( 'chld_thm_cfg_parent', trailingslashit( get_template_directory_uri() ) . 'style.css' ); } endif; add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css' ); // END ENQUEUE PARENT ACTION add_filter( 'mt_tickets_remaining_continuous_text', 'my_tickets_remaining_continuous_text' ); function my_tickets_remaining_continuous_text( $default ) { return "Seats Remaining: %s"; // your custom text }
Using the code above, you can see that I put mine in right after the child theme is enqueued. If you don’t have a child theme, or the above code, you could put it in at the very end of the functions.php, right before the final ?>
If this still doesn’t work for you, show me your functions.php. I’ll do what I can to help.
Thanks a lot. I tried to put it in. Now the site is still available, but the discribtion on the site still says “remaining”.
^
<?php
/* Load Omega theme framework. */
require ( trailingslashit( get_template_directory() ) . ‘lib/framework.php’ );
new Omega();/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which runs
* before the init hook. The init hook is too late for some features, such as indicating
* support post thumbnails.
*/
function omega_theme_setup() {//remove_theme_mods();
/* Load omega functions */
require get_template_directory() . ‘/lib/functions/hooks.php’;add_theme_support( ‘title-tag’ );
/* Load scripts. */
add_theme_support(
‘omega-scripts’,
array( ‘comment-reply’ )
);add_theme_support( ‘post-thumbnails’ );
add_theme_support( ‘omega-theme-settings’ );
add_theme_support( ‘omega-content-archives’ );
/* implement editor styling, so as to make the editor content match the resulting post output in the theme. */
add_editor_style();/* Support pagination instead of prev/next links. */
add_theme_support( ‘loop-pagination’ );/* Add default posts and comments RSS feed links to <head>. */
add_theme_support( ‘automatic-feed-links’ );/* Enable wraps */
add_theme_support( ‘omega-wraps’ );/* Enable custom post */
add_theme_support( ‘omega-custom-post’ );/* Enable custom css */
add_theme_support( ‘omega-custom-css’ );/* Enable custom logo */
add_theme_support( ‘omega-custom-logo’ );/* Enable child themes page */
add_theme_support( ‘omega-child-page’ );/* Handle content width for embeds and images. */
omega_set_content_width( 700 );}
add_action( ‘after_setup_theme’, ‘omega_theme_setup’ );
^The website is https://www.sup-revier.nrw, by the way.
THX a lot!
Sorry, I do not even know how to display the code right :/ The ^ in the end and the beginning are not part of the functions.php.
To display the code here on www.remarpro.com, you can press the “code” button at the top of the editor window, paste the code in, then press the code button again. Or use backticks (the key just left of the number ‘1’).
Try this for your functions.php:
<?php /* Load Omega theme framework. */ require ( trailingslashit( get_template_directory() ) . 'lib/framework.php' ); new Omega(); /** * Sets up theme defaults and registers support for various WordPress features. * * Note that this function is hooked into the after_setup_theme hook, which runs * before the init hook. The init hook is too late for some features, such as indicating * support post thumbnails. */ function omega_theme_setup() { //remove_theme_mods(); /* Load omega functions */ require get_template_directory() . '/lib/functions/hooks.php'; add_theme_support( 'title-tag' ); /* Load scripts. */ add_theme_support( 'omega-scripts', array( 'comment-reply' ) ); add_theme_support( 'post-thumbnails' ); add_theme_support( 'omega-theme-settings' ); add_theme_support( 'omega-content-archives' ); /* implement editor styling, so as to make the editor content match the resulting post output in the theme. */ add_editor_style(); /* Support pagination instead of prev/next links. */ add_theme_support( 'loop-pagination' ); /* Add default posts and comments RSS feed links to <head>. */ add_theme_support( 'automatic-feed-links' ); /* Enable wraps */ add_theme_support( 'omega-wraps' ); /* Enable custom post */ add_theme_support( 'omega-custom-post' ); /* Enable custom css */ add_theme_support( 'omega-custom-css' ); /* Enable custom logo */ add_theme_support( 'omega-custom-logo' ); /* Enable child themes page */ add_theme_support( 'omega-child-page' ); /* Handle content width for embeds and images. */ omega_set_content_width( 700 ); add_action( 'after_setup_theme', 'omega_theme_setup' ); } add_filter( 'mt_tickets_remaining_continuous_text', 'my_tickets_remaining_continuous_text' ); function my_tickets_remaining_continuous_text( $default ) { return "verfügbar: %s"; // your custom text } ?>
Hi Bdwatt0,
thanks for your help. I created a new functions.php with the code you posted, loaded it to my ftp. After reloading the site I get a white screen without any pic or text :/
I am wondering why it is so hard to change one single word.
Sorry skysurfer78, there must be something else interfering. I’m sorry I couldn’t help more.
No worries, thanks for your help so far. Maybe I just need to watch out for another plugin thats is more adaptable.
- The topic ‘Change wording of "Tickets Remaining"’ is closed to new replies.