1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<?php
include(TEMPLATEPATH.'/rttheme_options/includes.php');

/* Slider Widget */
if ( function_exists('register_sidebar') )
  register_sidebar(array(
    'ID'=> 'Slider_Widget',
        'name' => 'Slider Widget',
        'before_widget' => '<div class="box">',
        'after_widget' => '</div></div><div class="emptyspace"></div>',
        'before_title' => '<div class="titlearea2">',
        'after_title' => '</div><div class="textarea">',
));

/* Widget For Home Page Boxes */
if ( function_exists('register_sidebar') )
  register_sidebar(array(
    'ID'=> 'Home_Page_Widget',
        'name' => 'Home Page Widget',
        'before_widget' => '<div class="box">',
        'after_widget' => '</div></div><div class="emptyspace"></div>',
        'before_title' => '<div class="titlearea2"><h2>',
        'after_title' => '</h2></div><div class="textarea">',
));


/* Side Bar For Pages */
if ( function_exists('register_sidebar') )
    register_sidebar(array(
    'ID'=> 'Sidebar_For_Pages',
        'name' => 'Sidebar For Pages',
        'before_widget' => '<div class="box">',
        'after_widget' => '</div></div><div class="emptyspace"></div>',
        'before_title' => '<div class="titlearea2"><h2>',
        'after_title' => '</h2></div><div class="textarea">',
    ));


/*  Side Bar For Blog */
if ( function_exists('register_sidebar') )
  register_sidebar(array(
        'name' => 'Sidebar For Blog',
        'before_widget' => '<div class="box">',
        'after_widget' => '</div></div><div class="emptyspace"></div>',
        'before_title' => '<div class="titlearea2"><h2>',
        'after_title' => '</h2></div><div class="textarea">',
));

/*  Side Bar For Photo Gallery */
if ( function_exists('register_sidebar') )
  register_sidebar(array(
        'name' => 'Sidebar For Photo Gallery',
        'before_widget' => '<div class="box">',
        'after_widget' => '</div></div><div class="emptyspace"></div>',
        'before_title' => '<div class="titlearea2"><h2>',
        'after_title' => '</h2></div><div class="textarea">',
));

/* Sidebar For Contact Us */
if ( function_exists('register_sidebar') )
  register_sidebar(array(
    'ID'=> 'Sidebar_For_Contact_Us',
        'name' => 'Sidebar For Contact Us',
        'before_widget' => '<div class="box">',
        'after_widget' => '</div></div><div class="emptyspace"></div>',
        'before_title' => '<div class="titlearea2"><h2>',
        'after_title' => '</h2></div><div class="textarea">',
));

/* Side Bar For Pages&Blog&Templates */
if ( function_exists('register_sidebar') )
  register_sidebar(array(
        'name' => 'Common Sidebar',
        'before_widget' => '<div class="box">',
        'after_widget' => '</div></div><div class="emptyspace"></div>',
        'before_title' => '<div class="titlearea2"><h2>',
        'after_title' => '</h2></div><div class="textarea">',
));

/* Widget Area For Testimonials */
if ( function_exists('register_sidebar') )
  register_sidebar(array(
    'ID'=> 'Widget_Area_For_Testimonials',
        'name' => 'Widget Area For Testimonials',
        'before_widget' => '<div>',
        'after_widget' => '</div>',
        'before_title' => '',
        'after_title' => '',
));


/* Breadcrumb */
function rt_breadcrumb($gecerli_sayfa){

  if ( is_page() ){
        $ust_id=$gecerli_sayfa->post_parent;
        $yeni_sorgu = get_post($ust_id);       
         if($yeni_sorgu->post_parent) {
         rt_breadcrumb($yeni_sorgu);
         echo " \ ";
        }
        echo  "<a href=\"".get_permalink($yeni_sorgu->ID)."\" title=\"\" >". get_the_title($yeni_sorgu->ID) ."</a>";
  }
  elseif ( is_single() || is_category() && !is_archive()){
        $ust_id=$gecerli_sayfa->post_parent;
        $yeni_sorgu = get_post($ust_id);         
        $kategori= get_the_category($yeni_sorgu->ID);
        $ID = $kategori[0]->cat_ID;

        $ayrac=" &#92; ";

        echo get_category_parents($ID, TRUE, $ayrac , FALSE );

           if($yeni_sorgu->post_parent) {
           rt_breadcrumb($yeni_sorgu);
            if (! is_category() )  echo " \ ";
          }

        if ( is_single() ){
          echo  "<a href=\"".get_permalink($yeni_sorgu->ID)."\" title=\"\" >". get_the_title($yeni_sorgu->ID) ."</a>";
        }
  }else{
       echo  wp_title('');
  }
}

/* Pagination */
function get_pagination($range = 7){
  global $paged, $wp_query;
  if ( !$max_page ) {
    $max_page = $wp_query->max_num_pages;
  }
  if($max_page > 1){
    if(!$paged){
      $paged = 1;
    }

  if ($paged > 1){
    echo "<li>";
      previous_posts_link(' &laquo; ');
    echo "</li>";
  }
    if($max_page > $range){
      if($paged < $range){
        for($i = 1; $i <= ($range + 1); $i++){
      echo "<li";
      if($i==$paged) echo " class='active'";
      echo "><a href='" . get_pagenum_link($i) ."'>$i</a>";
          echo "</li>";
        }
      }
      elseif($paged >= ($max_page - ceil(($range/2)))){
        for($i = $max_page - $range; $i <= $max_page; $i++){
      echo "<li";
      if($i==$paged) echo " class='active'";
      echo "><a href='" . get_pagenum_link($i) ."'>$i</a>";
          echo "</li>";
        }
      }
      elseif($paged >= $range && $paged < ($max_page - ceil(($range/2)))){
        for($i = ($paged - ceil($range/2)); $i <= ($paged + ceil(($range/2))); $i++){

      echo "<li";
      if($i==$paged) echo " class='active'";
      echo "><a href='" . get_pagenum_link($i) ."'>$i</a>";
          echo "</li>";

        }
      }
    }
    else{
      for($i = 1; $i <= $max_page; $i++){
      echo "<li";
      if($i==$paged) echo " class=\"active\" ";
      echo "><a href='" . get_pagenum_link($i) ."'>$i</a>";
          echo "</li>";
      }
    }
  if ($paged != $max_page){
    echo "<li>";
     next_posts_link(' &raquo;  ');
    echo "</li>";
  }

  }
}
?>