Translate Multi Lingue Header Top and Header Main - wordpress

How can I translate the header-main and the header-top of a page? Link: novosite.iqnus.com.br
Maybe there is some hook to add in the functions.php file.
Thanks.

0) Read the translation docs: https://codex.wordpress.org/I18n_for_WordPress_Developers
1) Make sure the strings you want to translate are recognized in your Themes' gettext files - recompile and translate them accordingly and make sure the correct language files are available in the languages directory of your Theme
2) Every dynamic content can be translated by using Plugins like WPML or qTranslate

Try This plugin it's useful for Translate Multi language Header Top and Header Main
https://wordpress.org/plugins/gtranslate/screenshots/
You can put short code header.php where you show.

Related

In drupal 9. How can I add custom html between <head></head> Doing a hook or something rather than install a module

I am trying to add custom html between <head></head> Doing a hook or something rather than install a module.
But i cant figure how to doit.
I am using bartik and i make this function
function bartik_add_text_to_header(&$vars, $hook) {//}
but i cant figure how or which function to used.
I try with
drupal_set_html_head('style type="text/css">#import url(' . $GLOBALS[base_url] . '/modules/codefilter/codefilter.css);</style>');
But the drupal_set_html_head looks that is not existing in drupal 8 or 9
You should be using a custom theme with bartik as it's base theme rather than the bartik theme itself.
Just make the minimum file for a theme and set the bartik theme as it's base theme.
You can put whatever you want in the head section by overriding the template file that is currently being used to output that part of the html. For Bartik it is a file named html.html.twig in the core/themes/bartik/templates/classy/layout folder.
You would make a copy this file and put it into your custom themes templates folder so your file is used instead of the original.
To easily find what file is currently being used, you can enable twig debugging so comments are output in your html that show exactly what template files are being used.
Having said all that, and seeing as you are only looking to add css, you probably want to check out this page on Adding stylesheets (CSS) and JavaScript (JS) to a Drupal theme which will show you the different options you have to add js and css.
If you are just after a quick answer.... the function you want may be:
function fluffiness_preprocess_page(&$variables) {
$variables['#attached']['library'][] = 'fluffiness/global-styling';
}

Add comments to wordpress inspect element page

As the title says, I want to add some sort of signature with comments on my wordpress index file, thing is - there are 30 different index files and none of them seems to work
If I understand correctly, it'll just be a case of adding some HTML comments (not PHP comments as they won't show in the source code) in your theme files. Bear in mind that editing a theme won't work if someone else made it and releases updates to it as it'll overwrite your changes if you update it.
The best place to add in the comments is to either open the header.php file and place your HTML comments after the opening <body> tag. If your theme doesn't include a header file, you could always add your comments to the top of your themes index.php file instead.
Your theme should be located within /wp-content/themes/YOUR-THEME/.
Alternatively, you could also place HTML comments between the <head> tags of your theme so they show up a bit higher in the source code. To do this, it's probably best to use an action hook instead. Place this in your themes functions.php file:
add_action( 'wp_head', 'add_signature_to_theme', 1, 0 );
function add_signature_to_theme() {
?><!-- Welcome to my website. --><?php
}
The wp_head action hook documentation is useful to have as reference as well if you'd like a bit more information on what it is and what it does.

Wordpress child theme internationalization

I have followed the steps about "Internationalisation" on the wordpress codex page http://codex.wordpress.org/Child_Themes
To internationalize a child theme follow these steps:
Add a languages directory.
Something like my-theme/languages/.
Add language files.
Your filenames have to be he_IL.po & he_IL.mo (depending on your language), unlike plugin files which are domain-he_IL.xx.
Load a textdomain.
Use load_child_theme_textdomain() in functions.php during the after_setup_theme action.
The text domain defined in load_child_theme_textdomain() should be used to translate all strings in the child theme.
Use GetText functions to add i18n support for your strings.
What about the last step about using getText functions.
Please give me an example about using the getText function and where should I put these strings?
GetText functions are basically
__('mystring' , 'mytextdomain') and _e('mystring', 'mytextdomain') which is a wrapper for
echo __('mystring', 'mytextdomain')
All strings in your theme should be wrapped this way.
This is all detailed in http://codex.wordpress.org/I18n_for_WordPress_Developers which is a link on the page for creating Child Themes
You should always follow these kind on links in the codex, they give useful information ^^

Wordpress - where should I place editable CSS

Where do I place things like header's image, background color, background image...? Should I simply add them to html code? Or add pieces of the CSS to functions.php?
Also, when I add some code to head section from functions.php - will this be loaded automatically, or should I add something more to the head section myself?
you can change style.css for any css change
and header.php for header section,footer.php for footer section
for home content index.php file
you can call function from function.php file in to these files
If the theme you are using already has the HTML, then just modify the style.css. If the theme doesn't support the image placements that you want, you can either try to modify the HTML files yourself, or ask the theme creator to add it for you. If you modify this yourself, you'll have to remember that future updates to the theme may overwrite your changes.
If you are creating your own theme and don't care about flexibility, then add a spot in the HTML using your tags.

Using the WordPress TinyMCE in an HTML iframe for plugin

I have a WordPress plugin with settings page. On this settings page, the form to be submitted is loaded in an iframe. I wish to utilize the WordPress TinyMCE for a textarea in this form.
How do I achieve this? I can't really do it the way it is stated here (http://keighl.com/post/tinymce-in-wordpress-plugins/) since the form is present in an HTML file.
WORDPRESS 3.5 UPDATE BELOW
If you're using Wordpress version<3.0, you can use the post you referenced to, it's great.
If your wordpress version is above 3.0 (aka newer versions) you can't use the wp_tiny_mce function for the tiny_mce, because it's deprecated. You need the newer function, wp_editor, which you can read all about it in here:
http://codex.wordpress.org/Function_Reference/wp_editor
For you to use of the wp_editor function and other WP elements your iframe (the for now containing only html and not linked into wp), you need to make your the iframe html file a php file, and add a require function of wp-load.php file.
For example, if your iframe file is in your server's root folder with your wordpress install, all you need to do is to place the following in the top of your file:
<?php
require('./wp-load.php');
?>
//iframe html/php code here
After you do that you can use any wordpress function in your iframe, including the tiny_mce.
---- UPDATE ----
If you are using wordpress 3.5 or higher, the implement method has slightly changed. more information is right in this short tutorial

Resources