Jak přesunout wordpress na novou adresu/nový hosting

Poměrně častý dotaz mezi začínajícími uživateli wordpressu je, jak ho přesunout na novou adresu či na nový hosting a přitom si zachovat všechna nastavení, články i obrázky, které byly doposud vytvořeny. Existují na to pluginy, např. Backup and Move Plugin, ale v tomto tutoriálu si ukážeme ruční cestu. Tu jsem rozdělil do pěti jednoduchých kroků…. Číst dále

Podobné články tak trochu jinak

Určitě znáte spoustu různých pluginů, které vypisují podobné články. Je to většinou prosté, jednoduché a plně automatické. Pokud se trefí do návštěvníkova zájmu, udržíte si ho a on vám neodkráčí už na první stránce. Články ale vybírá počítač a ten je občas prostě tak trochu hloupý. Teď doufám, že se googlebot neurazí a nepřestane mi… Číst dále

Ořezy obrázků

Pokud jste někde vytvářeli či upravovali šablonu, určitě jste se setkali i s náhledovými obrázky článků. Díky funkcím wordpressu je nemusíte nahrávat ořezané či zmenšené, script to udělá za vás. Jeden obrázek je tak možné vkládat ve více velikostech. Základní jsou thumbnail (150, 150), medium (300, 300), large (1024, 1024) a full (bez zmenšení). Vytvářet […]

Jak změřit odeslání kontaktního formuláře CF7 v Google Analytics

V pluginu Contact Form 7 existuje pole *Additional Settings*, do kterého lze přidat kód pro měření

/—code php
on_sent_ok:“_gaq.push([‚_trackPageview‘, ‚/form-odeslan‘]);“
\—

a v nastavení cíle v GA se pak */form-odeslan* vloží do pole pro sledované URL (které ve skutečnosti neexistuje), match type = head match.

Viz též:
„Google Analytics Goals with Contact Form 7: The Right Way »“:http://www.bobzien.com/2010/10/22/google-analytics-goals-with-contact-form-7-the-right-way/
„Google Analytics’s tracking function »“:http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55514
„Stránka pluginu Contact Form 7 »“:http://ideasilo.wordpress.com/2009/05/31/contact-form-7-1-10/

Jak přidat vlastní pole do uživatelského profilu a zobrazit je na stránce

„This technique“:http://justintadlock.com/archives/2009/09/10/adding-and-using-custom-user-profile-fields will allow you to easily add new user profile fields that your blog’s users can use to input more information about themselves. In this tutorial, I’ll show you how to add an input box for a Twitter username and how to display it on your site.

In „this article“:http://www.wpbeginner.com/wp-tutorials/how-to-display-an-author-list-with-avatars-in-wordpress-contributors-page/ we will show you how you can create a contributors page which will display a list of authors with avatars or userphoto and any other information that you like.

The user profile of WordPress can be fairly easily adapted to add your own values​​. So you can add the necessary *custom fields* according to your requirements. „Here is“:http://wpengineer.com/2173/custom-fields-wordpress-user-profile/ how you do it.

Most free themes do not have a custom ***author.php*** file, WordPress automatically callback to ***archive.php*** or ***index.php*** when someone views the author profile page. The problem with that is that it will only list all the posts written by the author, and it provides no personal information about the author. It is recommended that you copy your ***archive.php*** and save it as ***author.php*** and modify it.

To get user’s (author’s) data from his/her profile, use „get_userdata function“:http://codex.wordpress.org/Function_Reference/get_userdata:

/—code php
first_name;
$last_name = $user_info->last_name;
$email = $user_info->user_email;
$description = $user_info->description;
$roles = $user_info->roles;
$username = $user_info->user_login;
?>
\—

obdobně funkce „get user by“:http://codex.wordpress.org/Function_Reference/get_user_by.

Vytváření vlastních widgetů

Widgets are small pieces of content that can be placed in one of the widgetized regions of your WordPress theme. A widget may contain some simple static content like a newsletter subscription form, introductory text, advertisements or some dynamic content such as a list of recent tweets from your Twitter account.

In „this article“:www.sitepoint.com/define-your-own-wordpress-widgets/ you will learn:

– How to create simple widgets without coding using the Text widget
– How to create dynamic data-driven widgets created through a WordPress plugin

„Embracing Drag-and-Drop Sidebars by Creating Your First WordPress Widget »“:http://www.sitepoint.com/embracing-drag-and-drop-sidebars-by-creating-your-first-wordpress-widget/

Správa několika webů nebo jazykových verzí v multisite instalaci

With multisite installation you can set up multiple blogs that share the same WordPress files, DB, plugins, themes.

Protože „WPML plugin“:https://wordpresso.ovx.cz/vicejazycny-web/ pro jazykové verze webů je nadále už k dispozici jen v komerční verzi, a u starších verzí WPML na posledních verzích WordPressu jsme zaznamenali problémy (např. zdvojování části URL), hodí se *multisite* instalace velmi dobře například jako náhrada WPML pro provoz jazykových verzí.
Použito (mj.) na webu „opavské jazykové školy Primalingua“:http://www.primalingua.cz/.

To wp-config.php file add line:

/—code php
define(‚WP_ALLOW_MULTISITE‘, true);
\—

In your Tools menu in the left sidebar, you’ll now see the **Network Setup** item. Click on that and then go to **Create a Network of WordPress Sites**. Follow the directions and choose a few options such as the URL structure and network name.

You’ll then be prompted to make a blogs.dir directory in /wp-content and it will provide several more lines of code to add to the wp-config.php file.

It will also tell you to add some rules to .htaccess, a server text file used to work with permissions and configurations for each directory.

When you log into the Network Admin, you’ll now see a **My Sites** item, where you can manage all the network sites. Hover over that, and under “Network Admin”, there will be several administration items. When you click on **Sites**, you can add new sites with the click of a button!

A WP network can manage any number of sites on different domains, sub-domains or paths. However, they must all reside on the same server.

**Klonování existujícího webu v síti**

– zazálohovat celou db
– založit skrz networkmanagera nový site
– zjistit prefixy tabulek té nové verze (wp_n+1)
– dumpnout databázi stávající verze (wp_n)
– nahradit v dumpu prefixy (wp_n > wp_n+1), ev. url (example.old > example.new)
– smazat tabulky nově vytvořené verze (wp_n+1)
– naimportovat replácnuté a přejmenované tabulky (wp_n+1)
– změnit siteurl ve wp_n+1_options na nové
– změnit nastavení jazyka (resp. siteurl) ve wp-admin/network/sites.php
– přiřadit nové verzi existující adminy

*a nebo – pohodlněji – s pomocí pluginu:*

**NS Cloner – Site Copier**
„https://wordpress.org/plugins/ns-cloner-site-copier/“:https://wordpress.org/plugins/ns-cloner-site-copier/

The NS Cloner saves multisite admins LOTS of time by enabling them to clone existing sites in their network to a completely new site in a few seconds.

**Související:**

„WordPress MU Domain Mapping“:http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/

This plugin allows users of a WordPress MU site or WordPress 3.0 network to map their blog/site to another domain.

„How to Get More From WordPress With Multisite Blogs (Network Install) »“:http://www.1stwebdesigner.com/tutorials/wordpress-multisite-blogs/

**WordPress Multisite Without a Domain Mapping Plugin**

You don’t need to use the domain mapping plugin if you are planning on running a WordPress Multisite with top-level domains and/or sudomains. WordPress allows you to change the domain from a sub-domain to a top level domain once you have added the site.

[* http://konstruktors.com/wp-content/uploads/2013/02/wordpress-multisite-top-level-domains-500×353.png *]

The only important thing is to set the COOKIE_DOMAIN to an empty string in your wp-config.php:

/—code php
define(‚COOKIE_DOMAIN‘, “);
\—

Otherwise WordPress will always set it to your network’s $current_site->domain and you won’t be able to login into any of the other sites.

„Zdroj »“:http://konstruktors.com/blog/wordpress/4510-wordpress-multisite-without-domain-mapping/

Začínáme s wordpressem, 3.část – psaní článků

Ve třetí části našeho tutoriálu si ukážeme, jak vlastně začít publikovat. Ve wordpressu jsou dva základní druhy článků – jsou jimi „Příspěvky“, v angličtině posts a „Stránky“, v angličtině pages. V drtivé většině věcí jsou stejné, ale mají mezi několik zásadních rozdílů. Zatímco příspěvky slouží spíše pro blogování, tak stránky jsou naopak statické stránky, u […]