Wordpress
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2102
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2102
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2102
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2102
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2102
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2102
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2102
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2102
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2102
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2102
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2102
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2102
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2102
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2102
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2102
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2102
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2102
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2102
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2102
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2102
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2102
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2102
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2102
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2102
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2102
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2102
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2435
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2451
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2456
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2461
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2467
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2479
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2496
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2497
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2498
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2499
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2517
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2518
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2519
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2520
Deprecated: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /home/clients/newman_ftp0/domains/wiki.pws.ru/html/includes/Parser.php on line 2550
Материал из Newman's WiKi.
| Версия 15:17, 21 сентября 2009 WikiSysop (Обсуждение | вклад) ← К предыдущему изменению |
Версия 09:24, 28 сентября 2009 WikiSysop (Обсуждение | вклад) (→Полезности) К след. изменению → |
||
| Строка 21: | Строка 21: | ||
| ===Ссылка на главную страницу=== | ===Ссылка на главную страницу=== | ||
| <pre>$mainlink=get_option("siteurl")</pre> | <pre>$mainlink=get_option("siteurl")</pre> | ||
| + | ===Использование стандартного редактора=== | ||
| + | 1. При инициализации плагина подключаем необходимые библиотеки | ||
| + | <pre> | ||
| + | //init script for TinyMCE editor | ||
| + | function plugin_tinymce() { | ||
| + | wp_admin_css('thickbox'); | ||
| + | wp_print_scripts('jquery-ui-core'); | ||
| + | wp_print_scripts('jquery-ui-tabs'); | ||
| + | wp_print_scripts('editor'); | ||
| + | add_thickbox(); | ||
| + | wp_print_scripts('media-upload'); | ||
| + | if (function_exists('wp_tiny_mce')) wp_tiny_mce(); | ||
| + | } | ||
| + | |||
| + | add_filter('admin_head','plugin_tinymce'); | ||
| + | </pre> | ||
| + | 2. В нужном месте показываем редактор | ||
| + | <pre> | ||
| + | <div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea"> | ||
| + | <label for="content"><?php _e('Text') ?></label><br> | ||
| + | <?php the_editor(StripSlashes($settingsdata["content"]), "content"); ?> | ||
| + | </div> | ||
| + | </pre> | ||
| + | 3. При обработке запроса текст будет в $_POST["content"] | ||
| ==Ссылки == | ==Ссылки == | ||
Версия 09:24, 28 сентября 2009
Содержание |
Небольшое описание
Wordpress является движком для блога. В общем случае позволяет создавать записи блога (посты) и простые страницы. Этим базовая комплектация исчерпывается :) Но возможность подключения плагинов расширяет возможности до бесконечности.
Система тем и шаблонов
Внешний вид сайта на wordpress задается с помощью системы шаблонов и тем.
Тема - это так сказать общая идея оформления. Одновременно на сайте может быть активизирована только одна тема. Каждая тема хранится в своей собственной папке внутри /wp-content/themes/ Название темы и ее параметры задаются через комментарии в файле style.css
Внутри любой темы может существовать несколько шаблонов. Шаблон это файл, находящийся в папке темы и определяющий отображение страницы. Название шаблона задается в самом начале файла в виде блока комментариев с использованием ключевого слова Template.
Движок выбирает шаблоны по довольной сложной системе. Конкретный шаблон может быть задан в параметрах страницы. Тогда для отображения страницы используется именно он. Если же в параметре стоит шаблон по умолчанию (default), то используется алгоритм выбора шаблона. Шаблон выбирается в зависимости от типа страницы. Так для страниц ищется файл page.php, для заглавной страницы файл home.php, для результатов поиска - search.php и т.д. Если эти файлы отсутствуют то используется файл index.php
Плагины (plugins)
Файлы с плагинами находятся в папке /wp-content/plugins. Плагин находится в файле PHP прямо в этой папке или же в подкаталоге. Установка плагина заключается в копировании файла в папку на сервере и в активизации его на панели плагинов. Более подробно о плагинах рассказано в статье Разработка plugin для WordPress.
Грабли
При установке Wordpress на Apache под Windows столкнулся с тем что Apache падает с критической ошибкой. Как выяснилось возникает какой-то конфликт процесса установки и Zend Optimizer. Вылечилось выключением оптимайзера.
Полезности
Ссылка на главную страницу
$mainlink=get_option("siteurl")
Использование стандартного редактора
1. При инициализации плагина подключаем необходимые библиотеки
//init script for TinyMCE editor
function plugin_tinymce() {
wp_admin_css('thickbox');
wp_print_scripts('jquery-ui-core');
wp_print_scripts('jquery-ui-tabs');
wp_print_scripts('editor');
add_thickbox();
wp_print_scripts('media-upload');
if (function_exists('wp_tiny_mce')) wp_tiny_mce();
}
add_filter('admin_head','plugin_tinymce');
2. В нужном месте показываем редактор
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea">
<label for="content"><?php _e('Text') ?></label><br>
<?php the_editor(StripSlashes($settingsdata["content"]), "content"); ?>
</div>
3. При обработке запроса текст будет в $_POST["content"]