I'm using Polylang on my clients website. They now have a blog, but the read more and submit button (for adding comments) are not translated into German. Also the title of the comment section is: Schreibe einen Kommentar, but my clients wants to change this into: Schreiben Sie einen Kommentar. Does anyone know how to do this?
I found this piece of code for the read more button on a older StackOVerflow topic:
function modify_read_more_link() {
return '' . pll__('read more') . '';
}
add_filter( 'the_content_more_link', 'modify_read_more_link' );
pll_register_string('my-theme', 'read more');
It is showing up in the String Translations, but the translation is not working on the website. I'm sure I'm doing something wrong since I know very little JavaScript. I'm really stuck so I hope someone on here can help me out.
Thank you in advance!
Kind regards,
Michelle
try
__('read more')
or
_e('read more')
Related
I'm trying to remove the word (-wordpress) from browser tab of login page but couldn't figure it out. Will be great if anyone could help here.
As it shows in the screenshot, im trying to remove the highlighted in yellow. Thanks
You'll want to do this in your theme's functions.php file. Here are some modifications that you can use:
function my_login_logo_url() {
return home_url();
}
add_filter( 'login_headerurl', 'my_login_logo_url' );
function my_login_logo_url_title() {
return 'Your Site Name and Info';
}
add_filter( 'login_headertitle', 'my_login_logo_url_title' );
For more information, please refer to the WordPress Codex page here.
I have to say I have found what you were looking for!
You'll have to head over to the 'wp-login' file and search for the $login_title attribute.
There you'll have to search for the word 'Wordpress' itself and erase it.
I fount mine on line 72.
You'll see the word as a string inside the parenthesis.
You'll have to go to the public_html and find the file there and change it.
I really hope It helped!
Good luck to anyone who reads it!
I am developing a multi language site with word press and wpml.
My problem is-
i have a link of a page(site.com/xyz) in a button in editor of a page which is in English. If i am in Spanish version of that page and and click that link(site.com/xyz) that goes to the English version.I want that goes to the Spanish version(site.com/es/xyz) of that page automatically instead of going to English version.(site.com/xyz).
Can anyone expert me out from it?
I hope i get some help from here.
Thanks
You need to use below the code for link
$url = get_the_permalink();
$wpml_permalink = apply_filters( 'wpml_permalink', $url , ICL_LANGUAGE_CODE );
site.com/xyz
This is question on the seo yoast wordporess plugin.
I have a friend who doesn't know that much about code/wordpress/etc, they have an ecommerce site built using magento and a blog using wordpress which is styled to match the main site and they use yoast seo plugin for seo etc. They have asked me to try an get the breadcrumbs working for them in a different way to what i know, from what i can see they want to add a prefix to the breadcrumbs 'home' which links to main site then renaming the blog from home to blog, for example home(main site) > blog(blog) > post.
Now i did just that in the plugin settings but they said that the schema markup wouldn't be complete and said there’s a filter hook called ‘wpseo_breadcrumb_links’ which gives access to the array of URLs and anchor text used to build the breadcrumbs, now i cant find anything on google that explains this or how to start writing it, i do know that it needs to go in the functions file.
Would it be possible to get some help on this.
Thanks in advance and very much appreciated.
Justin
I'm not sure what Schema.org markup has to do with breadcrumbs! :) Schema is used on post/page level. So, they are either oversmarting themselves or I got you wrong.
I think this sample code may be helpful:
add_filter( 'wpseo_breadcrumb_output', 'custom_wpseo_breadcrumb_output' );
function custom_wpseo_breadcrumb_output( $output ){
if( is_product() ){
$from = '<span typeof="v:Breadcrumb">Products</span> »';
$to = '';
$output = str_replace( $from, $to, $output );
}
return $output;
}
It looks like wpseo_breadcrumb_output gives you access to the entire output instead of just the link portion. Please see this page for more details: http://wpquestions.com/question/showChrono/id/8603
I would love to kinda replicate WordPress post/page text editor (Admin panel) in comments section. That's how site users will be able to format text easily. A good example of what I actually need can be found here at StackOverflow when someone is about to Ask Question.
In your functions.php, add the following snippet:
add_filter( 'comment_form_defaults', 'tinymce_comment_4265340' );
function tinymce_comment_4265340 ( $args ) {
ob_start();
wp_editor( '', 'comment', array('tinymce') );
$args['comment_field'] = ob_get_clean();
return $args;
}
It's working on WordPress 3.5 and Twenty Twelve theme.
The TinyMCEComment WordPress plugin could help you out. It uses the internal TinyMCE editor (bundled in WordPress 2.0 and up).
Try this tutorial. It worked for me. The above answer might add TinyMCE to the reply section. The tutorial shows how to fix that.
Ok, not technically a programming question but I want a plugin for my WordPress blog that displays code snippets.
Can anyone here recommend a good one? Also, do you guys know which one Jeff uses on codinghorror. That one looks really good.
Thanks.
wordpress.com claims to use Alex Gorbatchev’s syntaxhighlighter Google Code project.
I guess you might be interested in run-this - there is a wordpress plugin to allow your readers to run your snippets in the browser.
For WP-Snippets, I use Prettify.
You should probably use a plugin for escaping characters to be able to display code without having to do it yourself, or your code wont be displayed. Or just put this in functions.php in your theme folder to do this automatically:
function bbcode( $attr, $content = null ) {
$content = clean_pre($content); // Clean pre-tags
return '<pre"><code>' .
str_replace('<', '<', $content) . // Escape < chars
'</code></pre>';
}
add_shortcode('code', 'bbcode');
And then wrap your code with [code]<?php echo 'hello world!'; ?>[/code]
Source: Code in posts