Pop Up Comment Box In wordpress - wordpress

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.

Related

How to change the default URL of PublishPress Authors from "author" to "members"?

On a WordPress website I'm using BuddyBoss theme and I've added a glossary plugin.
I'm trying to add a Author Box to under each glossary term, to let site visitors visit the profile of its author. To do this, I've installed a plugin called PublishPress which almost does the job but by default the profile URLs leads to the person's author profile https://example.com/author/hisname/ which should be https://example.com/members/hisname/.
By googling I found a similar solution for another theme:
// FUNCTION
// Change Post's Author URL to Buddypress Profile URL
add_filter('generate_post_author_output','generate_post_author_output_buddyprss_url');
function generate_post_author_output_buddyprss_url( $post_author_profile_link ){
$post_author_profile_link = sprintf( ' <span class="byline">%1$s</span>',
sprintf( '<span class="author vcard" itemtype="http://schema.org/Person" itemscope="itemscope" itemprop="author">%1$s <a class="url fn n" href="%2$s" title="%3$s" rel="author" itemprop="url"><span class="author-name" itemprop="name">%4$s</span></a></span>',
__( 'by','generatepress'),
esc_url( bp_core_get_user_domain( get_the_author_meta( 'ID' ) ) ),
esc_attr( sprintf( __( 'Know more about %s', 'generatepress' ), get_the_author() ) ),
esc_html( get_the_author() )
)
) ;
return $post_author_profile_link;
}
I'm wondering how can I customize the script in order to do the exact job. To be honest I'm totally screwed up. Thanks for any help!
I fixed the issue by the pro version of the PublishPress Authors. In the pro version there's a possibility to edit the layout and there's a property returning the BuddyPress Profile Link.
<a href="{{ author.buddypress_profile_link }}"...
instead of:
<a href="{{ author.link }}"...

After changing WooCommerce mail templates, translation feature stops working. Why?

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.

Wordpress get navigation link string from language file

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.

How to remove the author name on wordpress blog posts?

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.

Replace author url with different one (wordpress)

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.

Resources