I'm using WooCommerce in Japanese and have just modified mail template 'customer-processing-order.php' to display the customer's full name instead of his/her first name.
//before
<p><?php printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ); ?></p>
//after
<p><?php printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_formatted_billing_full_name() ) ); ?></p>
This works fine, but the sentence below this is not translated to Japanese any more.
//This sentence is not translated to Japanese
<p><?php printf( esc_html__( 'Just to let you know — we\'ve received your order #%s, and it is now being processed:', 'woocommerce' ), esc_html( $order->get_order_number() ) ); ?></p>
I'm keeping this part intact and before making any changes, this part was translated to Japanese without problem.
Other Sentences following this are still translated into Japanese.
I have problem with just this sentence "Just to let you know — we've received your order #%s, and it is now being processed:"
I'd like to know why and the solution for this.
Additional info:
I modified mail template in admin screen going to:
WooCommerce > Settings > Emails > Processing order > Manage Then I
clicked 'Copy file to theme' button, then modified on edit screen.
WordPress Version 5.5 WooCommerce Version 4.4.1
Thank you in advance.
Related
for some reason the emails being sent to customers after they create a WooCommerce account displays a random name (see attached).
WooCommerce username error
I think because users can create an account with just an email address? But anyway - I want to just remove the Hi xxxx from all email communication from the customer. How do I do this? I am looking at the email templates but can't see how this code is generated?
To remove the name from email communication, you need to copy the email template file in your theme directory (e.g - customer-processing-order.php) on this find the below code:
<p><?php printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ); ?></p>
And replace with the below mentioned code:
<p><?php printf( esc_html__( 'Hi,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ); ?></p>
Same thing you can do for following Woocommerce email template files:
customer-completed-order.php
customer-completed-order.php
customer-invoice.php
customer-note.php
customer-on-hold-order.php
customer-processing-order.php
customer-refunded-order.php
Thanks - yes that solved the issue. The problem occurred because of a plugin conflict with a translation plugin. Thanks for the response to the question.
I Want to show pop up box on my Wordpress blog when someone want to make a comment in archive file , like i have "Leave a Comment" link in my index file and when user click on that it should be pop up with comment box rather than redirect to single post page
i have tried many Plugins but nothing works
this is my code in Wordpress
<?php comments_popup_link( __( 'Leave a comment', 'beautytemple' ), __( '1 Comment', 'beautytemple' ), __( '% Comments', 'beautytemple' ) ); ?>
If we are using comments_popup_link() function. We have to use the_loop, have_posts() ,the_post(). The comments_popup_link() will only work when we are using this function within the loop.
Good evening everyone,
I have been translating Surfarama theme into Russian and everything except navigation links on the bottom of post (next/previous) has been successfully translated.
In theme functions.php I found that it is hard coded into the theme (on line 601):
<?php previous_post_link( '<div class="nav-previous">%link</div>', '<span class="meta-nav">' . _x( '← Previous', 'Previous post link', 'surfarama' ) . '</span>' ); ?>
<?php next_post_link( '<div class="nav-next">%link</div>', '<span class="meta-nav">' . _x( 'Next →', 'Next post link', 'surfarama' ) . '</span>' ); ?>
How can I make '← Previous' to be extracted from ru_RU.po file as other theme strings which are not hard coded?
Solved my problem:
Replaced
_x( '← Previous', 'Previous post link', 'surfarama' )
with
__('← Previous', 'surfarama')
Now link is translated!
It was not translated because _x function second variable is a suggestion (for example it can be noun or verb), while __ function just makes string translatable. I also tried _e function (which echo'es translated string), but string somehow appeared before navigation, so I used __ instead.
Hope that someone will find this information useful.
I want to remove the author name from wordpress blog posts . Also I dont want to delete the author name becoz I use different author names from admin side.
WP v4.1.2
Edit content-single.php:
Appearance->Editor->content-single.php
<div class="entry-meta">
<?php // twentyeleven_posted_on(); ?>
</div><!-- .entry-meta -->
Comment the middle line "twentyeleven_posted_on();" like above
Title line on post saying: Published By AUTHOR on DATE will not be displayed
OR (less recommended as it effects a wider scale)
functions.php
COMMENTED LINE get_the_author()
function twentyeleven_posted_on() {
printf( __( '<span class="sep">Posted on </span><time class="entry-date" datetime="%3$s" pubdate>%4$s</time><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'twentyeleven' ),
esc_url( get_permalink() ),
esc_attr( get_the_time() ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_attr( sprintf( __( 'View all posts by %s', 'twentyeleven' ), get_the_author() ) )/*,
get_the_author()*/
);
}
Open the single.php file of your current theme through your ftp client or from Dashboard -->Appearance -->Editor
Delete this code :
<span class="meta_author"><?php the_author(); ?></span>
Hope this helps
You can comment/delete the line where author name is printed.
<span class="meta_author"><?php the_author(); ?></span>
I removed the author names from posts and search results on a site built with The7 theme by adding this custom CSS:
a.author.vcard {
display: none;
}
The other answers here that relate to the PHP code of WP are true, but alternatively this can also be done by modifying the CSS code of the site.
Under the main stylesheet file (style.css), you can add this definition:
.blog-title-body SPAN {
display:none !important;
}
This specifically will hide both the author name AND the category name under the header of the post page (the post name).
If you want to remove only the category name, for example, you can put in the following definition:
.blog-title-body SPAN.cat-links {
display:none !important;
}
NOTE:
be sure to always make a backup copy of every built-in file on WP site that you modify!!
It is also highly recommended to make an entire site backup periodically, with and without relation to modifications and changes.
There are 3 authors in our company blog, each author has own site url in profile settings:
Mike - http://mike.com
Gelens - http://gelens.com
Admin - http://site.com/company/
the links for profiles are:
http://site.com/author/Mike/
http://site.com/author/Gelens/
http://site.com/author/Admin/
I need to replace a link to Admin's page, so, if there is <?php the_author_posts_link(); ?> tag on some page, and the author is Admin, the link must be http://site.com/company/ instead of http://site.com/author/Admin/.
How can I do that?
It looks like the the_author_posts_link function just calls get_author_posts_url to get the link, which passes the link through the author_link filter before returning it. In your theme's functions.php, you could add something like this (untested):
add_filter( 'author_link', 'admin_author_link', 10, 3);
function admin_author_link($link, $author_id, $author_nicename) {
if( $author_id==1 ) {
$link = 'http://site.com/company/';
}
return $link;
}
I think the least heartburn would be wordpress > the_author_meta.
Have each user add their url in the wordpress user profile, as you have done. Then in your theme's functions.php use the_author_meta('user_url'). Remember this will echo the url. To use it as a variable use get_the_author_meta('user_url').
Here is how we did it with the twenty ten theme, this is in functions.php
function twentyten_posted_on() {
printf( __( '<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s', 'twentyten' ),
'meta-prep meta-prep-author',
sprintf( '<span class="entry-date">%3$s</span>',
get_permalink(),
esc_attr( get_the_time() ),
get_the_date()
),
sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>',
get_the_author_meta('user_url'), //changed from get_author_posts_url( get_the_author_meta( 'ID' ) ),
sprintf( esc_attr__( 'About %s', 'twentyten' ), get_the_author() ),
get_the_author()
)
);
}
That's URL rewriting with .htaccess, which is possible by editing the .htaccess by hand.
But easier for a beginner with a plugin such as http://wordpress.org/extend/plugins/redirection/ which seems like it will do what you need.
You can do this using http rewrites.
I also needed author URL to a different page.
My site is on WordPress and I use oxygen.
I went to my blog page template where I entered the author which is selected dynamically.
there is an option to link the author's name to the archive page or the author's website.
I selected the author's website. Then went to the users on WordPress and went to the authors and added the page I wanted to actually go to as their website.