This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function my_scripts_styles() { | |
wp_register_style( 'style', get_template_directory_uri() . '/style.css' ); | |
wp_enqueue_style( 'style' ); | |
} | |
add_action('wp_enqueue_scripts', 'my_scripts_styles'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Creez un fisier 'create_option.php', pe care il includ in functions.php si in care pun: | |
<?php | |
add_action('admin_menu', 'register_my_custom_submenu_page'); | |
function register_my_custom_submenu_page() { | |
add_submenu_page( 'themes.php', 'My Custom Submenu Page', 'My Custom Submenu Page', 'manage_options', 'my-custom-submenu-page', 'my_custom_submenu_page_callback' ); | |
//aici, mai pot folosi(si e recomandat sa fac asta) | |
//in loc de add_submenu_page | |
//add_theme_page('My Custom Submenu Page', 'My Custom Submenu Page', 'read', 'my-custom-submenu-page', 'my_custom_submenu_page_callback' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
E recomandat sa pun in style.css, si taguri despre tema. | |
Lista de taguri:http://wordpress.org/themes/about/ | |
Exemplu: | |
/* | |
Theme Name: Codeinwp theme | |
Theme URI: http://www.codeinwp.com | |
Author: Codeinwp | |
Author URI: http://www.codeinwp.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
textarea:focus, input:focus{ | |
outline: 0 !important; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sunt campuri pe care le poate completa cel care creeaza un post, in wp-admin, pe care le poate folosi in alt scop decat textul atasat postului. | |
Sunt de forma key/value. | |
Cum se creeaza: | |
- pe pagina de adaugare post, in wp-admin, dau la 'Custom Fields' (daca nu apare, e posibil ca e hidden si ma duc in dreapta sus, la Screen options, si activez Custom Fields). | |
- completez campurile de Name si Value si dau Add Custom Field | |
Obs: Dupa ce completez primul custom field, data viitoare, la name, o sa apara un dropdown list cu toate optiunile pe care le-am pus deja, din care pot sa aleg, sau pot adauga unul nou. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Metabox - sunt casutele din dreapta de la wp-admin, de la adaugare post. | |
- putem adauga unele noi, in plus fata de cele existente. | |
<?php | |
add_meta_box( $id, $title, $callback, $post_type, $context, | |
$priority, $callback_args ); | |
?> | |
EXEMPLU: | |
------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$page = (get_query_var('paged')) ? get_query_var('paged') : 1; | |
$args = array( | |
'paged' => $page, | |
... | |
); | |
query_posts( $args ); | |
if (have_posts()) : while (have_posts()) : the_post(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ca sa modific nr de comentarii a unui post care sunt afisate, ma duc in wp-admin, Setting -> Discussion -> Break comments into pages with top level comments per page and the page displayed by default | |
in comments.php | |
<div class="navigation"> | |
<?php | |
paginate_comments_links( array('prev_text' => 'prev', 'next_text' => 'next')); | |
?> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In comments.php: | |
<ul> | |
<?php | |
wp_list_comments('type=comment&callback=mytheme_comment'); | |
?> | |
</ul> | |
In functions.php: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$comments_args = array( | |
// change the title of send button | |
'label_submit'=>'Submit', | |
'comment_notes_before' => '', | |
// remove "Text or HTML to be displayed after the set of comment fields" | |
'comment_notes_after' => '', | |
// redefine your own textarea (the comment body) | |
'comment_field' => '<textarea id="comment" name="comment"></textarea>', | |
'fields' => array( |
OlderNewer