Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function lisans_yap() {
- $site_adresi = get_bloginfo("url");
- $lisans_kodu_cek = og_ayar("oz_lisans");
- $lisans_kod = trim($lisans_kodu_cek);
- if($lisans_kod) {
- if (md5(md5(strtoupper(md5(sha1($site_adresi))))) != $lisans_kod) {
- die( '<div class="ortala" style="width:444px;"><div class="kutu error ">HATA! Girilen lisans anahtarı hatalı yada eksik! <br/><br/>Lütfen size verilen lisans anahtarının doğru olduğuna emin olunuz! Eğer lisans anahtarınız yok ise, temayı kullanabilmek için lisans satın almanız gerekir. <br/><br/>Satın almak için <strong>oz-press@hotmail.com</strong> adresinden iletişime geçiniz.</div></div>' );
- }
- } else {
- die( '<div class="ortala" style="width:444px;"><div class="kutu error "> HATA! Lisanssız kullanım. <br/><br/>Lütfen satın aldığınız lisans anahtarını tema ayarları sayfasından ilgili alana giriniz. Eğer lisans anahtarınız yok ise, temayı kullanabilmek için lisans satın almanız gerekir. <br/><br/>Satın almak için <strong>oz-press@hotmail.com</strong> adresinden iletişime geçiniz.</div></div>' );
- }
- }
- add_action("wp_head","lisans_yap");
- update_option('users_can_register', 1);
- include_once("lib/panel.php");
- include(TEMPLATEPATH . '/lib/category_widget.php');
- include(TEMPLATEPATH . '/lib/comment_widget.php');
- include(TEMPLATEPATH . '/lib/fb_widget.php');
- include(TEMPLATEPATH . '/lib/random_widget.php');
- function disableAutoSave(){
- wp_deregister_script('autosave');
- }
- add_action( 'wp_print_scripts', 'disableAutoSave' );
- remove_filter('term_description','wpautop');
- function unregister_default_wp_widgets(){
- unregister_widget( "WP_Widget_Calendar" );
- unregister_widget( "WP_Widget_Links" );
- unregister_widget( "WP_Widget_Meta" );
- unregister_widget( "WP_Widget_Search" );
- unregister_widget( "WP_Widget_Recent_Comments" );
- unregister_widget( "WP_Widget_RSS" );
- }
- add_action( "widgets_init", "unregister_default_wp_widgets", 1 );
- remove_action( "wp_head", "wlwmanifest_link" );
- remove_action( "wp_head", "wp_generator" );
- remove_action( "wp_head", "rsd_link" );
- remove_action( "wp_head", "start_post_rel_link" );
- remove_action( "wp_head", "index_rel_link" );
- remove_action( "wp_head", "adjacent_posts_rel_link" );
- function _remove_script_version( $src ){
- $parts = explode( '?', $src );
- return $parts[0];
- }
- add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
- add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );
- /*------------------------------------------------------------
- OZMovie Özel Alan
- -------------------------------------------------------------
- */
- $isim = og_ayar('isim_alan');
- $imdb = og_ayar('imdb_alan');
- $oyuncu = og_ayar('oyuncular_alan');
- $yil = og_ayar('yapim_alan');
- $yonetmen = og_ayar('yonetmen_alan');
- $ozet = og_ayar('ozet_alan');
- $fragman = og_ayar('fragman_alan');
- function alanlar( $metalar ) {
- global $post;
- if ($metalar == 'isim'){
- echo $isim;
- }
- if($metalar == 'yil') {
- echo $yil;
- }
- if($metalar == 'oyuncular') {
- echo $oyuncu;
- }
- if($metalar == 'imdb') {
- echo $imdb;
- }
- if($metalar == 'yonetmen') {
- echo $yonetmen;
- }
- if($metalar == 'ozet') {
- echo $ozet;
- }
- }
- /*------------------------------------------------------------
- OZMovie Part
- -------------------------------------------------------------
- */
- function ozmovie_part( $args = "" )
- {
- $defaults = array(
- "before" => "".__( "".$bilgi."" ),
- "after" => "",
- "link_before" => "<span>",
- "link_after" => "</span>",
- "echo" => 1 );
- $r = wp_parse_args( $args, $defaults );
- extract( $r, EXTR_SKIP );
- global $page;
- global $numpages;
- global $multipage;
- global $more;
- global $pagenow;
- global $pages;
- $part_bir = get_option( "ozmovie_ilk" );
- $output = "";
- if ( $multipage )
- {
- $output .= $before;
- $i = 1;
- while ( $i < $numpages + 1 )
- {
- $part_content = $pages[$i - 1];
- $has_part_title = strpos( $part_content, "<!--baslik:" );
- if ( 0 === $has_part_title )
- {
- $end = strpos( $part_content, "-->" );
- $title = trim( str_replace( "<!--baslik:", "", substr( $part_content, 0, $end ) ) );
- }
- $output .= " ";
- if ( $i != $page || !$more && $page == 1 )
- {
- $output .= _wp_link_page( $i );
- }
- $output .= $link_before.$title.$link_after;
- if ( $i != $page || !$more && $page == 1 )
- {
- $output .= "</a>";
- }
- $i = $i + 1;
- }
- $output .= $after;
- }
- if ( $echo )
- {
- echo $output;
- }
- return $output;
- }
- /*------------------------------------------------------------
- OZMovie İzlenme
- -------------------------------------------------------------
- */
- function getPostViews($postID){
- $count_key = 'views';
- $count = get_post_meta($postID, $count_key, true);
- if($count==''){
- delete_post_meta($postID, $count_key);
- add_post_meta($postID, $count_key, '0');
- return "0";
- }
- return $count.'';
- }
- function setPostViews($postID) {
- $count_key = 'views';
- $count = get_post_meta($postID, $count_key, true);
- if($count==''){
- $count = 0;
- delete_post_meta($postID, $count_key);
- add_post_meta($postID, $count_key, '0');
- }else{
- $count++;
- update_post_meta($postID, $count_key, $count);
- }
- }
- /*------------------------------------------------------------
- OZMovie Custom Write Panel Buttons
- -------------------------------------------------------------
- */
- if( !function_exists('_add_my_quicktags') ){
- function _add_my_quicktags()
- { ?>
- <script type="text/javascript">
- QTags.addButton( 'php', 'Sonraki Part', '<!--nextpage-->' );
- QTags.addButton( 'isim', 'Part ismi','<!--baslik:', '-->');
- </script>
- <?php }
- add_action('admin_print_footer_scripts', '_add_my_quicktags');
- }
- /*------------------------------------------------------------
- OZMovie Custom Taxonomies
- -------------------------------------------------------------
- */
- function add_custom_taxonomies() {
- register_taxonomy('imdb', 'post', array('hierarchical' => false,'labels' => array(
- 'name' => _x( 'IMDB', 'taxonomy general name' ),
- 'singular_name' => _x( 'IMDB Puanı', 'taxonomy singular name' ),
- 'search_items' => __( 'IMDB Puanı ara' ),
- 'all_items' => __( 'Tüm IMDB Puanları' ),
- 'edit_item' => __( 'IMDB Puanı düzenle' ),
- 'update_item' => __( 'IMDB Puanı güncelle' ),
- 'add_new_item' => __( 'Yeni IMDB Puanı ekle' ),
- 'new_item_name' => __( 'Yeni IMDB Puanı' ),
- 'menu_name' => __( 'IMDB Puanları' ),
- ),
- 'rewrite' => array(
- 'slug' => 'imdb', // This controls the base slug that will display before each term
- 'with_front' => false, // Don't display the category base before "/locations/"
- 'hierarchical' => false // This will allow URL's like "/locations/boston/cambridge/"
- ),
- ));
- register_taxonomy('oyuncu', 'post', array('hierarchical' => false,'labels' => array(
- 'name' => _x( 'Oyuncu', 'taxonomy general name' ),
- 'singular_name' => _x( 'Oyuncu', 'taxonomy singular name' ),
- 'search_items' => __( 'Oyuncu ara' ),
- 'all_items' => __( 'Tüm oyuncular' ),
- 'edit_item' => __( 'Oyuncu düzenle' ),
- 'update_item' => __( 'Oyuncu güncelle' ),
- 'add_new_item' => __( 'Yeni oyuncu ekle' ),
- 'new_item_name' => __( 'Yeni oyuncu adı' ),
- 'menu_name' => __( 'Oyuncular' ),
- ),
- 'rewrite' => array(
- 'slug' => 'oyuncu', // This controls the base slug that will display before each term
- 'with_front' => false, // Don't display the category base before "/locations/"
- 'hierarchical' => false // This will allow URL's like "/locations/boston/cambridge/"
- ),
- ));
- register_taxonomy('yapim', 'post', array('hierarchical' => false,'labels' => array(
- 'name' => _x( 'Yapım Yılı', 'taxonomy general name' ),
- 'singular_name' => _x( 'Yapım Yılı', 'taxonomy singular name' ),
- 'search_items' => __( 'Yapım Yılı ara' ),
- 'all_items' => __( 'Tüm yıllar' ),
- 'edit_item' => __( 'Yapım Yılı düzenle' ),
- 'update_item' => __( 'Yapım Yılı güncelle' ),
- 'add_new_item' => __( 'Yeni Yapım Yılı ekle' ),
- 'new_item_name' => __( 'Yeni Yapım Yılı' ),
- 'menu_name' => __( 'Yapım Yılı' ),
- ),
- 'rewrite' => array(
- 'slug' => 'yapim', // This controls the base slug that will display before each term
- 'with_front' => false, // Don't display the category base before "/locations/"
- 'hierarchical' => false // This will allow URL's like "/locations/boston/cambridge/"
- ),
- ));
- register_taxonomy('yonetmen', 'post', array('hierarchical' => false,'labels' => array(
- 'name' => _x( 'Yönetmen', 'taxonomy general name' ),
- 'singular_name' => _x( 'Yönetmen', 'taxonomy singular name' ),
- 'search_items' => __( 'Yönetmen ara' ),
- 'all_items' => __( 'Tüm yönetmenler' ),
- 'edit_item' => __( 'Yönetmen düzenle' ),
- 'update_item' => __( 'Yönetmen güncelle' ),
- 'add_new_item' => __( 'Yeni yönetmen ekle' ),
- 'new_item_name' => __( 'Yeni yönetmen adı' ),
- 'menu_name' => __( 'Yönetmenler' ),
- ),
- 'rewrite' => array(
- 'slug' => 'yonetmen', // This controls the base slug that will display before each term
- 'with_front' => false, // Don't display the category base before "/locations/"
- 'hierarchical' => false // This will allow URL's like "/locations/boston/cambridge/"
- ),
- ));
- }
- add_action( 'init', 'add_custom_taxonomies', 0 );
- /*------------------------------------------------------------
- OZMovie Custom Write Panel
- -------------------------------------------------------------
- */
- $prefix = 'dbt_';
- $orisim = og_ayar('isim_alan');
- $pfragman = og_ayar('fragman_alan');
- $pozet = og_ayar('ozet_alan');
- $meta_box = array(
- 'id' => 'my-meta-box',
- 'title' => 'Film Bilgileri',
- 'page' => 'post',
- 'context' => 'normal',
- 'priority' => 'high',
- 'fields' => array(
- array(
- 'name' => 'Orjinal İsim',
- 'desc' => 'Filmin orjinal ismini girin.',
- 'id' => 'orjinal_isim' ,
- 'type' => 'text',
- 'std' => ''
- ),
- array(
- 'name' => 'Film hakkında',
- 'desc' => 'Film hakkında kısa bir yazı girin.',
- 'id' => 'dbt_film_hakkinda' ,
- 'type' => 'editor',
- 'std' => ''
- ),
- array(
- 'name' => 'SEO Title',
- 'desc' => 'Filme ait özel bir başlık girebilirsiniz',
- 'id' => '_aioseop_title' ,
- 'type' => 'text',
- 'std' => ''
- ),
- array(
- 'name' => 'SEO Description',
- 'desc' => 'Filme ait özel bir açıklama girebilirsiniz. (MAX. 160 KARAKTER)',
- 'id' => '_aioseop_description' ,
- 'type' => 'textarea',
- 'std' => ''
- ),
- array(
- 'name' => 'SEO Keywords',
- 'desc' => 'Filme ait özel bir anahtar kelimeler girebilirsiniz. Aralarına virgül koymayı unutmayın.',
- 'id' => '_aioseop_keywords' ,
- 'type' => 'text',
- 'std' => ''
- )
- )
- );
- add_action('admin_menu', 'mytheme_add_box');
- add_filter( wp_editor, 'the_content');
- // Add meta box
- function mytheme_add_box() {
- global $meta_box;
- add_meta_box($meta_box['id'], $meta_box['title'], 'mytheme_show_box', $meta_box['page'], $meta_box['context'], $meta_box['priority']);
- }
- // Callback function to show fields in meta box
- function mytheme_show_box() {
- global $meta_box, $post;
- // Use nonce for verification
- echo '<input type="hidden" name="mytheme_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';
- echo '<table class="form-table">';
- foreach ($meta_box['fields'] as $field) {
- // get current post meta data
- $meta = get_post_meta($post->ID, $field['id'], true);
- $editor_settings = apply_filters('rwmb_wysiwyg_settings', array( 'wpautop' => TRUE, 'media_buttons' => FALSE, 'editor_class' => 'rwmb-wysiwyg', ), 10, 1 );
- echo '<tr>',
- '<th style="width:20%"><label for="', $field['id'], '">', $field['name'], '</label></th>',
- '<td>';
- switch ($field['type']) {
- case 'text':
- echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta ? $meta : $field['std'], '" size="30" style="width:97%" />',
- '<br />', $field['desc'];
- break;
- case 'editor':
- $editin = wp_editor( $meta, $field['id'], $editor_settings );
- echo apply_filters( 'the_content', $editin );
- echo '<br />', $field['desc'];
- break;
- case 'textarea':
- echo '<textarea name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="4" style="width:97%">', $meta ? $meta : $field['std'], '</textarea>',
- '<br />', $field['desc'];
- break;
- case 'select':
- echo '<select name="', $field['id'], '" id="', $field['id'], '">';
- foreach ($field['options'] as $option) {
- echo '<option', $meta == $option ? ' selected="selected"' : '', '>', $option, '</option>';
- }
- echo '</select>';
- break;
- case 'radio':
- foreach ($field['options'] as $option) {
- echo '<input type="radio" name="', $field['id'], '" value="', $option['value'], '"', $meta == $option['value'] ? ' checked="checked"' : '', ' />', $option['name'];
- }
- break;
- case 'checkbox':
- echo '<input type="checkbox" name="', $field['id'], '" id="', $field['id'], '"', $meta ? ' checked="checked"' : '', ' />';
- break;
- }
- echo '<td>',
- '</tr>';
- }
- echo '</table>';
- }
- add_action('save_post', 'mytheme_save_data');
- // Save data from meta box
- function mytheme_save_data($post_id) {
- global $meta_box;
- // verify nonce
- if (!wp_verify_nonce($_POST['mytheme_meta_box_nonce'], basename(__FILE__))) {
- return $post_id;
- }
- // check autosave
- if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
- return $post_id;
- }
- // check permissions
- if ('page' == $_POST['post_type']) {
- if (!current_user_can('edit_page', $post_id)) {
- return $post_id;
- }
- } elseif (!current_user_can('edit_post', $post_id)) {
- return $post_id;
- }
- foreach ($meta_box['fields'] as $field) {
- $old = get_post_meta($post_id, $field['id'], true);
- $new = $_POST[$field['id']];
- if ($new && $new != $old) {
- update_post_meta($post_id, $field['id'], $new);
- } elseif ('' == $new && $old) {
- delete_post_meta($post_id, $field['id'], $old);
- }
- }
- }
- /*------------------------------------------------------------
- OZMovie Cache Sistemi
- -------------------------------------------------------------
- */
- function filmtimi_cachesil(){
- delete_transient( 'cacheHEADER' );
- delete_transient( 'cacheUST' );
- delete_transient( 'cacheRAST' );
- delete_transient( 'cacheLOOP' );
- delete_transient( 'cacheSOSYAL' );
- delete_transient( 'cacheREKLAM' );
- delete_transient( 'cacheYORUM' );
- delete_transient( 'cacheAD' );
- delete_transient( 'cacheMANSET' );
- delete_transient( 'cacheTAVSIYE' );
- delete_transient( 'cacheRASTGELE' );
- delete_transient( 'cacheFOOTER' );
- }
- add_action('publish_post', 'filmtimi_cachesil');
- add_action('update_post', 'filmtimi_cachesil');
- add_action('delete_post', 'filmtimi_cachesil');
- add_action('edit_post', 'filmtimi_cachesil');
- add_action('ogpanel_ayarlar', 'filmtimi_cachesil');
- /*------------------------------------------------------------
- OZMovie Öne Çıkarılmış Görsel
- -------------------------------------------------------------
- */
- add_theme_support( 'post-thumbnails' );
- add_image_size( 'midi', 164, 235, true);
- add_image_size( 'tavsiye', 110, 164, true);
- add_image_size( 'mini', 45, 64, true);
- add_filter('post_thumbnail_html', 'remove_feat_img_title');
- function remove_feat_img_title($img) {
- $img = preg_replace('/title="(.*?)"/','',$img);
- return $img;
- }
- /*------------------------------------------------------------
- OZMovie Menüler
- -------------------------------------------------------------
- */
- add_action( 'init', 'theme_menus' );
- function theme_menus() {
- register_nav_menus(
- array(
- 'menu-1' => __( 'Anamenu' ),
- 'menu-2' => __( 'FooterMenu' ),
- )
- );
- }
- /*------------------------------------------------------------
- OZMovie Yorumlar
- -------------------------------------------------------------
- */
- function mytheme_comment($comment, $args, $depth) {
- $GLOBALS['comment'] = $comment; ?>
- <li id="yorum-<?php comment_ID() ?>">
- <div class="avatarKapsul">
- <?php $authID = get_the_author_meta('ID');if($authID == $comment->user_id){?>
- <a href="<?php echo site_url(); ?>/?author=<?php the_author_ID(); ?>"><?php echo get_avatar( $comment->comment_author_email, 58 ); ?></a></div><!--avatar bitiş-->
- <div class="yorumKapsul">
- <h4><a href="<?php echo site_url(); ?>/?author=<?php the_author_ID(); ?>"><?php printf(__('<strong>%s</strong>'), get_comment_author_link()) ?></a></h4>
- <span><?php echo human_time_diff( get_comment_time('U'), current_time('timestamp') ) . ' önce'; ?></span>
- <div class="clear"></div>
- <div class="yorumMetin">
- <?php comment_text() ?>
- <?php if ($comment->comment_approved == '0') : ?>
- <em><?php _e('Your comment is awaiting moderation.') ?></em>
- <?php endif; ?>
- </div><!--yorumMetin bitiş-->
- </div><!--yorumKapsul bitiş-->
- <?php } else {?>
- <?php echo get_avatar( $comment->comment_author_email, 58 ); ?></div><!--avatar bitiş-->
- <div class="yorumKapsul">
- <h4><?php printf(__('<strong>%s</strong>'), get_comment_author_link()) ?></h4>
- <span><?php echo human_time_diff( get_comment_time('U'), current_time('timestamp') ) . ' önce'; ?></span>
- <div class="clear"></div>
- <div class="yorumMetin">
- <?php comment_text() ?>
- <?php if ($comment->comment_approved == '0') : ?>
- <em><?php _e('Your comment is awaiting moderation.') ?></em>
- <?php endif; ?>
- </div><!--yorumMetin bitiş-->
- </div><!--yorumKapsul bitiş-->
- <?php } ?>
- </li>
- <?php
- }
- add_filter('next_posts_link_attributes', 'posts_link_attributes_1');
- add_filter('previous_posts_link_attributes', 'posts_link_attributes_2');
- function posts_link_attributes_1() {
- return 'id="prev-post"';
- }
- function posts_link_attributes_2() {
- return 'id="next-post"';
- }
- /*------------------------------------------------------------
- OZMovie Sidebar
- -------------------------------------------------------------
- */
- if ( function_exists('register_sidebar') )
- register_sidebar(array('name'=>'Sidebar',
- 'before_title' => '<div class="sideBas"><h2>',
- 'after_title' => '</h2></div><!--sideBas bitiş-->',
- 'before_widget' => '<div class="sideitem" id="%1$s">',
- 'after_widget' => '</div>',
- ));
- /*------------------------------------------------------------
- OZMovie Exclude pages from search results
- -------------------------------------------------------------
- */
- function remove_pages_from_search($query) {
- if ($query->is_search) {
- $query->set('post_type', 'post');
- }
- return $query;
- }
- add_filter('pre_get_posts','remove_pages_from_search');
- //
- function my_custom_login_logo() {
- echo '<style type="text/css">
- h1 a { background-image:url('.get_bloginfo('template_directory').'/img/logo.png) !important; background-size:286px 90px!important; height:90px!important; }
- </style>';
- }
- add_action('login_head', 'my_custom_login_logo');
- ?>
- <?php
- /*------------------------------------------------------------
- OZMovie Custom User Profile
- -------------------------------------------------------------
- */
- add_action( 'show_user_profile', 'extra_user_profile_fields' );
- add_action( 'edit_user_profile', 'extra_user_profile_fields' );
- function extra_user_profile_fields( $user ) { ?>
- <h3><?php _e("Ekstra bilgiler", "blank"); ?></h3>
- <table class="form-table">
- <tr>
- <th><label for="fb"><?php _e("Facebook adresiniz"); ?></label></th>
- <td>
- <input type="text" name="fb" id="fb" value="<?php echo esc_attr( get_the_author_meta( 'fb', $user->ID ) ); ?>" class="regular-text" /><br />
- <span class="description"><?php _e("Facebook adresinizi girin."); ?></span>
- </td>
- </tr>
- <tr>
- <th><label for="tw"><?php _e("Twitter adresiniz"); ?></label></th>
- <td>
- <input type="text" name="tw" id="tw" value="<?php echo esc_attr( get_the_author_meta( 'tw', $user->ID ) ); ?>" class="regular-text" /><br />
- <span class="description"><?php _e("Twitter adresinizi girin."); ?></span>
- </td>
- </tr>
- <tr>
- <th><label for="user_select"><?php _e("Cinsiyetiniz"); ?></label></th>
- <td><?php $selected = get_the_author_meta( 'user_select', $user->ID ); ?>
- <select name="user_select" id="user_select" style="width: 318px;">
- <option value="Erkek" <?php echo ($selected == "Erkek")? 'selected="selected"' : '' ?>>Erkek</option>
- <option value="Kadın" <?php echo ($selected == "Kadın")? 'selected="selected"' : '' ?>>Kadın</option>
- </select>
- <span class="description"><?php _e("Cinsiyetinizi seçin."); ?></span>
- </td>
- </tr>
- </table>
- <?php }
- add_action( 'personal_options_update', 'save_extra_user_profile_fields' );
- add_action( 'edit_user_profile_update', 'save_extra_user_profile_fields' );
- function save_extra_user_profile_fields( $user_id ) {
- if ( !current_user_can( 'edit_user', $user_id ) ) { return false; }
- update_usermeta( $user_id, 'user_select', $_POST['user_select'] );
- update_usermeta( $user_id, 'tw', $_POST['tw'] );
- update_usermeta( $user_id, 'fb', $_POST['fb'] );
- }
- /*------------------------------------------------------------
- OZMovie Custom User Avatar
- -------------------------------------------------------------
- */
- if (!function_exists('oz_avatar')) { function oz_avatar($avatar_defaults) { $new_default_icon = get_bloginfo('template_directory') .'/img/avatar.png';
- $avatar_defaults[$new_default_icon] = 'Avatar';
- return $avatar_defaults;
- }
- add_filter( 'avatar_defaults' , 'oz_avatar' ); }
- remove_action('wp_head', 'wlwmanifest_link');
- remove_action('wp_head', 'rsd_link');
- /*------------------------------------------------------------
- OZMovie Page Create
- -------------------------------------------------------------
- */
- $page_id = $wpdb->get_var("SELECT ID FROM " . $wpdb->posts . " WHERE post_name = 'en-cok-izlenenler';");
- if (!$page_id) {
- $my_page = array(
- 'post_status' => 'publish',
- 'post_type' => 'page',
- 'post_author' => 1,
- 'post_name' => 'en-cok-izlenenler',
- 'post_title' => 'En Çok İzlenenler'
- );
- $page_id = wp_insert_post($my_page);
- update_post_meta($page_id, '_wp_page_template', 'en-cok-izlenenler.php');
- } else {
- update_post_meta($page_id, '_wp_page_template', 'en-cok-izlenenler.php');
- }
- $page_id = $wpdb->get_var("SELECT ID FROM " . $wpdb->posts . " WHERE post_name = 'en-cok-yorumlananlar';");
- if (!$page_id) {
- $my_page = array(
- 'post_status' => 'publish',
- 'post_type' => 'page',
- 'post_author' => 1,
- 'post_name' => 'en-cok-yorumlananlar',
- 'post_title' => 'En Çok Yorumlananlar'
- );
- $page_id = wp_insert_post($my_page);
- update_post_meta($page_id, '_wp_page_template', 'en-cok-yorumlananlar.php');
- } else {
- update_post_meta($page_id, '_wp_page_template', 'en-cok-yorumlananlar.php');
- }
- $page_id = $wpdb->get_var("SELECT ID FROM " . $wpdb->posts . " WHERE post_name = 'favoriler';");
- if (!$page_id) {
- $my_page = array(
- 'post_status' => 'publish',
- 'post_type' => 'page',
- 'post_author' => 1,
- 'post_content' => '{{wp-favorite-posts}}',
- 'post_name' => 'favoriler',
- 'post_title' => 'Favoriler'
- );
- $page_id = wp_insert_post($my_page);
- update_post_meta($page_id, '_wp_page_template', 'favoriler.php');
- } else {
- update_post_meta($page_id, '_wp_page_template', 'favoriler.php');
- }
- $page_id = $wpdb->get_var("SELECT ID FROM " . $wpdb->posts . " WHERE post_name = 'giris';");
- if (!$page_id) {
- $my_page = array(
- 'post_status' => 'publish',
- 'post_type' => 'page',
- 'post_author' => 1,
- 'post_name' => 'giris',
- 'post_title' => 'Giriş'
- );
- $page_id = wp_insert_post($my_page);
- update_post_meta($page_id, '_wp_page_template', 'page-login.php');
- } else {
- update_post_meta($page_id, '_wp_page_template', 'page-login.php');
- }
- $page_id = $wpdb->get_var("SELECT ID FROM " . $wpdb->posts . " WHERE post_name = 'kayit';");
- if (!$page_id) {
- $my_page = array(
- 'post_status' => 'publish',
- 'post_type' => 'page',
- 'post_author' => 1,
- 'post_name' => 'kayit',
- 'post_title' => 'Kayıt'
- );
- $page_id = wp_insert_post($my_page);
- update_post_meta($page_id, '_wp_page_template', 'page-register.php');
- } else {
- update_post_meta($page_id, '_wp_page_template', 'page-register.php');
- }
- $page_id = $wpdb->get_var("SELECT ID FROM " . $wpdb->posts . " WHERE post_name = 'profil';");
- if (!$page_id) {
- $my_page = array(
- 'post_status' => 'publish',
- 'post_type' => 'page',
- 'post_author' => 1,
- 'post_name' => 'profil',
- 'post_title' => 'Profil'
- );
- $page_id = wp_insert_post($my_page);
- update_post_meta($page_id, '_wp_page_template', 'page-profil.php');
- } else {
- update_post_meta($page_id, '_wp_page_template', 'page-profil.php');
- }
- $page_id = $wpdb->get_var("SELECT ID FROM " . $wpdb->posts . " WHERE post_name = 'sifre';");
- if (!$page_id) {
- $my_page = array(
- 'post_status' => 'publish',
- 'post_type' => 'page',
- 'post_author' => 1,
- 'post_name' => 'sifre',
- 'post_title' => 'Şifre'
- );
- $page_id = wp_insert_post($my_page);
- update_post_meta($page_id, '_wp_page_template', 'page-sifre.php');
- } else {
- update_post_meta($page_id, '_wp_page_template', 'page-sifre.php');
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement