Sie sind auf Seite 1von 4

/* For CSS

Theme:subtle bridge
Theme URI:http://tareq.net16.net
Author:Tareq Jamal
Author:http://tareq.net16.net
Version:0.1
Description:simple website
Tags:simple website
*/
in HTML tag
<?php language_attributes();?>
in meta charset tag
<?php bloginfo('charset');?>
in meta description
<?php bloginfo('description');?>
when click on logo it will go to home page by writing this code into <a> tag
<?php bloginfo('home')?>
for generating CSS
{
<?php bloginfo('template_directory');?>
<?php bloginfo('template_url');?>
<?php echo get_template_directory_uri();?>
for useful <?php echo esc_url(get_template_directory_uri());?>
We can get with link <?php bloginfo('stylesheet_url');?>
}
for title name
<?php bloginfo('title');?>
for description in the title name
<?php bloginfo('description');?>
according to new rule of wordpress for add a title in file functions.php
<?php
add_theme_support('title-tag');
?>

To add header image option in dashboard write down the code in func tions.php no
ted below
<?php
add_theme_support('custom-header');
?>
To add dynamic image from dashboard write down the code in index.php where it ne
eds to be
<?php
header_image();
?>
To add deafult image write down the code in functions.php

<?php
$args = array(
'default-image' => get_template_directory_uri() . '/images/header.png',
);
add_theme_support( 'custom-header', $args );
<--- To add whole image size write inline CSS code in index.php file 0 0/ 100% 1
00%-->
?>
To add background image write down a code in functions.php
<?php add_theme_support('custom-background');?>
then write a code in index.php inside body tag
<?php body_class();?>

To add menu
//textdomain
load_theme_textdomain('subtle',get_template_directory_uri().'/languages');
register_nav_menus(
array(
'primarymenu' => __('Main Menu','subtle'),
'secondarymenu' => __('Footer Menu','subtle')
));
?>
And write down this code in index.php as well
<?php
wp_nav_menu(array(
'theme_location' => 'primarymenu'
));
?>

to add featured image code in functions.php


add_theme_support('post-thumbnails');
then write down the code in index.php page
<?php the_post_thumbnail();?>

To register widget in functions.php


function newdesign_sidebar(){
register_sidebar(array(
'name' => 'left sidebar',
'description' => 'You can add more sidebar from here',
'id' => 'leftsidebar',

'before_title' => '<h3>',


'after_title' => '<h3/>',
'before_widget' => '',
'after_widget' => '',
));
register_sidebar(array(
'name' => 'right sidebar',
'description' => 'You can add more right sidebar from here',
'id' => 'rightsidebar'
));
}
add_action('widgets_init','newdesign_sidebar');
write down the code in index.php which has been followed
<?php dynamic_sidebar();?>
To get title name of a post
<?php the_title;?>
To get Author name
<?php the_author();?>
To See comment with link
<?php comments_popup_link();?>
to Get content
<?php the_content();?>
To get comment option
<?php comments_template();?>
To add slider wriite the code in functions.php
register_post_type('zboom',array(
'labels' => array(
'name' =>'Slider',
'add_new_item' => 'New item add koren'
),
'public' =>true,
'supports' =>array('title','editor','thumbnail')
));
then write down the in specific page
<?php
$slideritem = new WP_Query(array(
'post_type' => 'zboom'
));
?>
<?php while($slideritem->have_posts()):$slid
eritem->the_post();?>
<li><?php the_post_thumbnail();?></li>

<?php endwhile; ?>


To get serach form
<?php get_search_form();?>

For navigation
<?php
the_posts_navigation(array(
'prev_text'=>'Prev',
'next_text'=>'NEXT',
'screen_reader_text'=>' '
);
?>

For pagination
<?php
the_posts_pagination(array(
'show_all' => false,
'prev_text' => 'PREV',
'next_text' => 'NEXT',
'screen_reader_text' => ' ',
'before_page_number' => '<b><i>',
'after_page_number' => '</i></b>'
));
?>

Das könnte Ihnen auch gefallen