رفتن به مطلب

Detroit-City

عضو سایت
  • تعداد ارسال‌ها

    102
  • تاریخ عضویت

  • آخرین بازدید

نوشته‌ها ارسال شده توسط Detroit-City

  1. پشتیبانی هاست گفت:

    "فایل های وبسایت به مسیر درست منتقل گردید،همچنین تنظیمات مربوط به Conection String نیز انجام شد.اما هنگام لود وبسایت با خطای عدم پیدا کردن فایل wp-load.php برخورد میشود.برای حل این موضوع با طراح وبسایت خود در تماس باشید."

    طراح وبسایت ندارم / لطفا یکی کمک کنه.

  2. سلام

    من یک هاست جدید خریدم و یک فول بکاپ از سایتم گرفتم و به هاستینگ جدید انتقال دادم.

    دیتابیس هم درست کردم دیتابیسم را ایمپورت کردم.

    حالا سایت بالا نمیاد بقیه کارها را یکی که بلد هست بگه تا دسترسی بدم. (مبلغ هم برای این زحمتی که میکشید اعلام کنید تا واریز کنم.)

  3. سلام

    سایت موقع لود شدن کند هست و دلیل اصلی این کندی fonts.googleapis.com هست. داخل انجم جستجو کردم ولی مشکل حل نشد.

    این کد در چند فایل از قالب هست. مثل فایل functions.php

    $fonts_url = add_query_arg( $query_args, "//fonts.googleapis.com/css" );

    و فایل magnor-functions.php

    wp_enqueue_style( 'opensans-user', "$protocol://fonts.googleapis.com/css?family=BYekan:300,400,500,(more)

    حالا این fonts.googleapis.com را چطور باید حذف کرد؟ یعنی چه چیزی را باید حذف کرد که برای سایت مشکل پیش نیاد؟

    ممنون

  4. بعضی هاستینگ ها از فصای هساتینگ خودتون برای بک آپ گرفتن استفاده میکنند

    تو مسیر root هاستتون فولدری باید باشه با نام temp یا tmp که یه سری فایل ها رو بصورت موقت اونجا نگه داری میکنه که ضروری نیستند و بعد از اینکه کارش با اون فایل و اطلاعات تموم شد پاک نمیشن !

    سلام

    من از دایرکت ادمین استفاده میکنم و فضای Size هر پوشه و فایل کاملا مشخصه و مشکل من حجم فایل ها یا پوشه ها نیست(لطفا این پست را از اول بخوانید).

    مشکل حجم دیتابیس هست (حجم دیتابیس 3 برابر حجم واقعی مطالب هست) که ضاهرا یک افزونه باعث این مشکل شده و با حذف اون افزونه حجم دیتابیس تغییر نکرده.

  5. وقتی جدول wp_options را باز میکنم 23000 صفحه داره و وقتی به صفحه 23000 میرم تعداد صفحات میشه 31000 و وقتی روی صفحه 31000 میرم برمیگرده صفحه 1

    بیشترین محتوای این جدول (Option name) زیر هستند.

    transient_timeout

    transient_wc

    اگه این اطلاعات مربوط به افزونه باشند, افزونه حذف بشه این اطلاعات هم حذف میشند یا خیر؟

  6. افزونه Revision Control میتونه تاثیر زیادی داشته باشه اگه تعداد پست ها بالا باشه

    لطف میکنید توضیح بدید این افزونه Revision Control چیکار میکنه؟ چون این افزونه بهمراه قالب خریداری شده نصب شد.

    سایت من فروشگاهی هست و از ووکامرس استفاده میکنم.

    این افزونه قابل حذف شدن هست؟ یعنی مشکلی برای سایت پیش نمیاد؟

  7. ممنون

    بله درست هست در سایت دوم از قالب و افزونه های دیگه ای استفاده میکنم.

    حجم دیتابیس سایت اول خیلی بیشتر از سایت دوم هست (3 برابر), آیا اطلاعات بیخودی در دیتابیس وجود دارد؟ قابل پاک شدن هست؟

    قبل از ارسال این تیکت از افزونه WP-Optimize استفاده کردم ولی حجم قابل توجهی کم نشد.!

  8. سلام

    من از سایت اول خروجی گرفتم (برون بری همه محتوا) و در سایت جدید ایمپورت کردم(با تصاویر).

    مشکل با حجم فایل ها ندارم, ولی چرا حجم دیتابیس سایت اول 223 مگابایت و سایت دوم (سایت جدید) 73 مگابایت هست؟ (این دو سایت مطالب کاملا مشابهی دارند.)

    آیا در هنگام درون ریزی محتوایی جا مانده (خودم با کلی برسی به این نتیجه نرسیدم). پس دلیل چی هست؟

  9. سلام

    ممنون ولی نتونسم از تگ < /a > استفاده کنم.

    این کد مال قالب هست. فکر کنم قالب هم از افزونه Black Studio TinyMCE Widget استفاده میکنه.

    میخام به 4 عکس (مستطیل شکل) زیر لینک بدم.

    5vj2lvvo4dxo9f4awg8f.png

    کد یکی از این تصاویر مستطیل


    [/tm_cms_banner][/one_fourth][one_fourth][tm_cms_banner background_color="db3981" background_img="Pic.jpg " maintitle="tasvir" subtitle="2"]

    صفحه قالب

  10. سلام

    میخام کد "حداقل خرید" را از کد زیر جدا کنم و به فایل فانکشن اضافه کنم.

    لطفا کد رادر فایل فانکشن من قرار بدید.

    کد حداقل خرید (این کد را از یک فروشگاه دیگه گرفتم)


    /*-----------------------------------------------------------------------------------*/
    /* Don't add any code below here or the sky will fall down */
    /*-----------------------------------------------------------------------------------*/
    ?>
    <?php
    function cs_wc_loop_add_to_cart_scripts() {
    if ( is_shop() || is_product_category() || is_product_tag() || is_product() ) : ?>
    <script>
    jQuery(document).ready(function($) {
    $(document).on( 'change', '.quantity .qty', function() {
    $(this).parent('.quantity').next('.add_to_cart_button').attr('data-quantity', $(this).val());
    });
    });
    </script>
    <?php endif;
    }
    add_action( 'wp_footer', 'cs_wc_loop_add_to_cart_scripts' );
    add_action( 'woocommerce_checkout_process', 'wc_minimum_order_amount' );
    add_action( 'woocommerce_before_cart' , 'wc_minimum_order_amount' );
    function wc_minimum_order_amount() {
    // Set this variable to specify a minimum order value
    $minimum = 18000;
    if ( WC()->cart->total < $minimum ) {
    if( is_cart() ) {
    wc_print_notice(
    sprintf( 'حداقل سفارش محصول 18.000 تومان است' ,
    woocommerce_price( $minimum ),
    woocommerce_price( WC()->cart->total )
    ), 'error'
    );
    } else {
    wc_add_notice(
    sprintf( 'حداقل سفارش محصول 18.000 تومان است' ,
    woocommerce_price( $minimum ),
    woocommerce_price( WC()->cart->total )
    ), 'error'
    );
    }
    }
    }
    ?>
    <?php
    add_action( 'init', 'wc_add_cart_button_for_loop' );
    function wc_add_cart_button_for_loop() {
    add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
    }
    ?>

    فایل فانکشن من

    <?php

    /**

    * Set up the content width value based on the theme's design.

    *

    * @see templatemela_content_width()

    *

    * @since TemplateMela 1.0

    */

    if ( ! isset( $content_width ) ) {

    $content_width = 604;

    }

    function templatemela_setup() {

    /*

    * This theme styles the visual editor to resemble the theme style,

    * specifically font, colors, icons, and column width.

    */

    add_editor_style( array( 'css/font-awesome.css', '/fonts/css/font-awesome.css', templatemela_fonts_url() ) );

    // Adds RSS feed links to <head> for posts and comments.

    add_theme_support( 'automatic-feed-links' );

    /*

    * Switches default core markup for search form, comment form,

    * and comments to output valid HTML5.

    */

    add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list' ) );

    /*

    * This theme supports all available post formats by default.

    * See http://codex.wordpre...rg/Post_Formats

    */

    add_theme_support( 'post-formats', array(

    'aside', 'image', 'video', 'audio', 'quote', 'link', 'gallery',

    ) );

    global $wp_version;

    if ( version_compare( $wp_version, '3.4', '>=' ) ) {

    add_theme_support( 'custom-background' );

    }

    // This theme uses wp_nav_menu() in one location.

    register_nav_menus( array(

    'primary' => __( 'TM Header Navigation', 'templatemela' ),

    'header-menu' => __('TM Header Top Links', 'templatemela'),

    'footer-menu' => __('TM Footer Navigation', 'templatemela'),

    ) );

    /*

    * This theme uses a custom image size for featured images, displayed on

    * "standard" posts and pages.

    */

    add_theme_support( 'post-thumbnails' );

    set_post_thumbnail_size( 604, 270, true );

    // This theme uses its own gallery styles.

    add_filter( 'use_default_gallery_style', '__return_false' );

    }

    add_action( 'after_setup_theme', 'templatemela_setup' );

    /*

    * Makes Templatemela available for translation.

    *

    * Translations can be added to the /languages/ directory.

    * If you're building a theme based on Templatemela, use a find and

    * replace to change 'templatemela' to the name of your theme in all

    * template files.

    */

    function templatemela_textdomain_setup() {

    load_theme_textdomain( 'templatemela', get_template_directory() . '/langg' );

    $locale = get_locale();

    $locale_file = get_template_directory() . "/languages/$locale.php";

    if ( is_readable( $locale_file ) ) {

    require_once( $locale_file );

    }

    }

    add_action( 'after_setup_theme', 'templatemela_textdomain_setup' );

    /********************************************************

    **************** TEMPLATE MELA CONTENT WIDTH ******************

    ********************************************************/

    function templatemela_content_width() {

    if ( is_attachment() && wp_attachment_is_image() ) {

    $GLOBALS['content_width'] = 810;

    }

    }

    add_action( 'template_redirect', 'templatemela_content_width' );

    /**

    * Getter function for Featured Content Plugin.

    *

    * @since TemplateMela 1.0

    *

    * @return array An array of WP_Post objects.

    */

    function templatemela_get_featured_posts() {

    /**

    * Filter the featured posts to return in TemplateMela.

    * @param array|bool $posts Array of featured posts, otherwise false.

    */

    return apply_filters( 'templatemela_get_featured_posts', array() );

    }

    /**

    * A helper conditional function that returns a boolean value.

    * @return bool Whether there are featured posts.

    */

    function templatemela_has_featured_posts() {

    return ! is_paged() && (bool) templatemela_get_featured_posts();

    }

    /********************************************************

    **************** TEMPLATE MELA SIDEBAR ******************

    ********************************************************/

    function templatemela_widgets_init() {

    register_sidebar( array(

    'name' => __( 'Main Sidebar', 'templatemela' ),

    'id' => 'sidebar-1',

    'description' => __( 'Appears on posts and pages except the optional Front Page template, which has its own widgets', 'templatemela' ),

    'before_widget' => '<aside id="%1$s" class="widget %2$s">',

    'after_widget' => "</aside>",

    'before_title' => '<h1 class="widget-title">',

    'after_title' => '</h1>',

    ) );

    register_sidebar( array(

    'name' => __( 'Secondary Sidebar', 'templatemela' ),

    'id' => 'sidebar-2',

    'before_widget' => '<aside id="%1$s" class="widget %2$s">',

    'after_widget' => "</li></ul></aside>",

    'before_title' => '<h3 class="widget-title">',

    'after_title' => '</h3><ul class="main-ul"><li>',

    ));

    register_sidebar( array(

    'name' => __( 'Homepage Sidebar', 'templatemela' ),

    'id' => 'sidebar-home',

    'description' => __( 'Appears on posts and pages in Front Page template, which has its own widgets', 'templatemela' ),

    'before_widget' => '<aside id="%1$s" class="widget %2$s">',

    'after_widget' => "</aside>",

    'before_title' => '<h1 class="widget-title">',

    'after_title' => '</h1>',

    ) );

    }

    add_action( 'widgets_init', 'templatemela_widgets_init' );

    /********************************************************

    **************** TEMPLATE MELA FONT SETTING ******************

    ********************************************************/

    function templatemela_fonts_url() {

    $fonts_url = '';

    /* Translators: If there are characters in your language that are not

    * supported by Source Sans Pro, translate this to 'off'. Do not translate

    * into your own language.

    */

    $source_sans_pro = _x( 'on', 'Source Sans Pro font: on or off', 'templatemela' );

    /* Translators: If there are characters in your language that are not

    * supported by Bitter, translate this to 'off'. Do not translate into your

    * own language.

    */

    $bitter = _x( 'on', 'Bitter font: on or off', 'templatemela' );

    if ( 'off' !== $source_sans_pro || 'off' !== $bitter ) {

    $font_families = array();

    if ( 'off' !== $source_sans_pro )

    $font_families[] = 'Source Sans Pro:300,400,700,300italic,400italic,700italic';

    if ( 'off' !== $bitter )

    $font_families[] = 'Bitter:400,700';

    $query_args = array(

    'family' => urlencode( implode( '|', $font_families ) ),

    'subset' => urlencode( 'latin,latin-ext' ),

    );

    $fonts_url = add_query_arg( $query_args, "//fonts.googleapis.com/css" );

    }

    return $fonts_url;

    }

    /********************************************************

    ************ TEMPLATE MELA SCRIPT SETTING ***************

    ********************************************************/

    function templatemela_scripts_styles() {

    // Add Source Sans Pro and Bitter fonts, used in the main stylesheet.

    wp_enqueue_style( 'templatemela-fonts', templatemela_fonts_url(), array(), null );

    // Add Genericons font, used in the main stylesheet.

    wp_enqueue_style( 'font_awesome', get_template_directory_uri() . '/fonts/css/font-awesome.css', array(), '2.09' );

    // Add Genericons font, used in the main stylesheet.

    wp_enqueue_style( 'font', get_template_directory_uri() . '/fonts/ArialRoundedMT.css',array());

    // Loads our main stylesheet.

    wp_enqueue_style( 'templatemela-style', get_stylesheet_uri(), array(), '2014-02-01' );

    /*

    * Adds Javascript to pages with the comment form to support

    * sites with threaded comments (when in use).

    */

    if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {

    wp_enqueue_script( 'comment-reply' );

    }

    if ( is_singular() && wp_attachment_is_image() ) {

    wp_enqueue_script( 'templatemela-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20130402' );

    }

    // Loads Javascript file with functionality specific to Templatemela.

    wp_enqueue_script( 'templatemela-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '2014-02-01', true );

    // Adds Javascript for handling the navigation menu hide-and-show behavior.

    wp_enqueue_script( 'templatemela-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '1.0', true );

    }

    add_action( 'wp_enqueue_scripts', 'templatemela_scripts_styles' );

    /********************************************************

    ************ TEMPLATE MELA ADMIN FONT SETTING ***************

    ********************************************************/

    function templatemela_admin_fonts() {

    wp_enqueue_style( 'templatemela-fonts', templatemela_fonts_url(), array(), null );

    }

    add_action( 'admin_print_scripts-appearance_page_custom-header', 'templatemela_admin_fonts' );

    /********************************************************

    ************ TEMPLATE MELA IMAGE ATTACHMENT ***************

    ********************************************************/

    if ( ! function_exists( 'templatemela_the_attached_image' ) ) :

    /**

    * Print the attached image with a link to the next attached image.

    * @return void

    */

    function templatemela_the_attached_image() {

    /**

    * Filter the image attachment size to use.

    *

    * @since Templatemela 1.0

    *

    * @param array $size {

    * @type int The attachment height in pixels.

    * @type int The attachment width in pixels.

    * }

    */

    $attachment_size = apply_filters( 'templatemela_attachment_size', array( 724, 724 ) );

    $next_attachment_url = wp_get_attachment_url();

    $post = get_post();

    /*

    * Grab the IDs of all the image attachments in a gallery so we can get the URL

    * of the next adjacent image in a gallery, or the first image (if we're

    * looking at the last image in a gallery), or, in a gallery of one, just the

    * link to that image file.

    */

    $attachment_ids = get_posts( array(

    'post_parent' => $post->post_parent,

    'fields' => 'ids',

    'numberposts' => -1,

    'post_status' => 'inherit',

    'post_type' => 'attachment',

    'post_mime_type' => 'image',

    'order' => 'ASC',

    'orderby' => 'menu_order ID'

    ) );

    // If there is more than 1 attachment in a gallery...

    if ( count( $attachment_ids ) > 1 ) {

    foreach ( $attachment_ids as $attachment_id ) {

    if ( $attachment_id == $post->ID ) {

    $next_id = current( $attachment_ids );

    break;

    }

    }

    // get the URL of the next image attachment...

    if ( $next_id )

    $next_attachment_url = get_attachment_link( $next_id );

    // or get the URL of the first image attachment.

    else

    $next_attachment_url = get_attachment_link( array_shift( $attachment_ids ) );

    }

    printf( '<a href="%1$s" title="%2$s" rel="attachment">%3$s</a>',

    esc_url( $next_attachment_url ),

    the_title_attribute( array( 'echo' => false ) ),

    wp_get_attachment_image( $post->ID, $attachment_size )

    );

    }

    endif;

    /********************************************************

    ************ TEMPLATE MELA GET URL **********************

    ********************************************************/

    function templatemela_get_link_url() {

    $content = get_the_content();

    $has_url = get_url_in_content( $content );

    return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink() );

    }

    /********************************************************

    ************ TEMPLATE MELA LIST AUTHOR SETTING**************

    ********************************************************/

    if ( ! function_exists( 'templatemela_list_authors' ) ) :

    /**

    * Print a list of all site contributors who published at least one post.

    * @return void

    */

    function templatemela_list_authors() {

    $contributor_ids = get_users( array(

    'fields' => 'ID',

    'orderby' => 'post_count',

    'order' => 'DESC',

    'who' => 'authors',

    ) );

    foreach ( $contributor_ids as $contributor_id ) :

    $post_count = count_user_posts( $contributor_id );

    // Move on if user has not published a post (yet).

    if ( ! $post_count ) {

    continue;

    }

    ?>

    <div class="contributor">

    <div class="contributor-info">

    <div class="contributor-avatar"><?php echo get_avatar( $contributor_id, 132 ); ?></div>

    <div class="contributor-summary">

    <h2 class="contributor-name"><?php echo get_the_author_meta( 'display_name', $contributor_id ); ?></h2>

    <p class="contributor-bio"> <?php echo get_the_author_meta( 'description', $contributor_id ); ?> </p>

    <a class="contributor-posts-link" href="<?php echo esc_url( get_author_posts_url( $contributor_id ) ); ?>"> <?php printf( _n( '%d Article', '%d Articles', $post_count, 'templatemela' ), $post_count ); ?> </a> </div>

    <!-- .contributor-summary -->

    </div>

    <!-- .contributor-info -->

    </div>

    <!-- .contributor -->

    <?php

    endforeach;

    }

    endif;

    /**

    * Extend the default WordPress body classes.

    *

    * Adds body classes to denote:

    * 1. Single or multiple authors.

    * 2. Presence of header image.

    * 3. Index views.

    * 4. Full-width content layout.

    * 5. Presence of footer widgets.

    * 6. Single views.

    * 7. Featured content layout.

    *

    * @since TemplateMela 1.0

    *

    * @param array $classes A list of existing body class values.

    * @return array The filtered body class list.

    */

    function templatemela_body_classes( $classes ) {

    if ( is_multi_author() ) {

    $classes[] = 'group-blog';

    }

    if ( get_header_image() ) {

    $classes[] = 'header-image';

    } else {

    $classes[] = 'masthead-fixed';

    }

    if ( is_archive() || is_search() || is_home() ) {

    $classes[] = 'list-view';

    }

    if ( ( ! is_active_sidebar( 'sidebar-2' ) )

    || is_page_template( 'page-templates/full-width.php' )

    || is_page_template( 'page-templates/contributors.php' )

    || is_attachment() ) {

    //$classes[] = 'full-width';

    }

    if ( is_singular() && ! is_front_page() ) {

    $classes[] = 'singular';

    }

    if ( is_front_page() && 'slider' == get_theme_mod( 'featured_content_layout' ) ) {

    $classes[] = 'slider';

    } elseif ( is_front_page() ) {

    $classes[] = 'grid';

    }

    return $classes;

    }

    add_filter( 'body_class', 'templatemela_body_classes' );

    /**

    * Extend the default WordPress post classes.

    *

    * Adds a post class to denote:

    * Non-password protected page with a post thumbnail.

    * @param array $classes A list of existing post class values.

    * @return array The filtered post class list.

    */

    function templatemela_post_classes( $classes ) {

    if ( ! post_password_required() && has_post_thumbnail() ) {

    $classes[] = 'has-post-thumbnail';

    }

    return $classes;

    }

    add_filter( 'post_class', 'templatemela_post_classes' );

    /**

    * Create a nicely formatted and more specific title element text for output

    * in head of document, based on current view.

    * @param string $title Default title text for current view.

    * @param string $sep Optional separator.

    * @return string The filtered title.

    */

    function templatemela_wp_title( $title, $sep ) {

    global $paged, $page;

    if ( is_feed() ) {

    return $title;

    }

    // Add the site name.

    $title .= get_bloginfo( 'name' );

    // Add the site description for the home/front page.

    $site_description = get_bloginfo( 'description', 'display' );

    if ( $site_description && ( is_home() || is_front_page() ) ) {

    $title = "$title $sep $site_description";

    }

    // Add a page number if necessary.

    if ( $paged >= 2 || $page >= 2 ) {

    $title = "$title $sep " . sprintf( __( 'Page %s', 'templatemela' ), max( $paged, $page ) );

    }

    return $title;

    }

    add_filter( 'wp_title', 'templatemela_wp_title', 10, 2 );

    // Implement Custom Header features.

    require get_template_directory() . '/inc/custom-header.php';

    // Custom template tags for this theme.

    require get_template_directory() . '/inc/template-tags.php';

    // Add Theme Customizer functionality.

    require get_template_directory() . '/inc/customizer.php';

    /*

    * Add Featured Content functionality.

    *

    * To overwrite in a plugin, define your own Featured_Content class on or

    * before the 'setup_theme' hook.

    */

    if ( ! class_exists( 'Featured_Content' ) && 'plugins.php' !== $GLOBALS['pagenow'] ) {

    require get_template_directory() . '/inc/featured-content.php';

    }

    include_once("templatemela/megnor-functions.php");

    ?>

  11. سلام

    لطفا یک نفر کد "حداقل خرید" را از کد زیر جدا کنه و به فایل فانکشن من اضافه کنه. ممنون میشم.

    این کد را از یک فروشگاه دیگه گرفتم


    /*-----------------------------------------------------------------------------------*/
    /* Don't add any code below here or the sky will fall down */
    /*-----------------------------------------------------------------------------------*/
    ?>
    <?php
    function cs_wc_loop_add_to_cart_scripts() {
    if ( is_shop() || is_product_category() || is_product_tag() || is_product() ) : ?>

    <script>
    jQuery(document).ready(function($) {
    $(document).on( 'change', '.quantity .qty', function() {
    $(this).parent('.quantity').next('.add_to_cart_button').attr('data-quantity', $(this).val());
    });
    });
    </script>

    <?php endif;
    }

    add_action( 'wp_footer', 'cs_wc_loop_add_to_cart_scripts' );
    add_action( 'woocommerce_checkout_process', 'wc_minimum_order_amount' );
    add_action( 'woocommerce_before_cart' , 'wc_minimum_order_amount' );
    function wc_minimum_order_amount() {
    // Set this variable to specify a minimum order value
    $minimum = 18000;

    if ( WC()->cart->total < $minimum ) {

    if( is_cart() ) {

    wc_print_notice(
    sprintf( 'حداقل سفارش محصول 18.000 تومان است' ,
    woocommerce_price( $minimum ),
    woocommerce_price( WC()->cart->total )
    ), 'error'
    );

    } else {

    wc_add_notice(
    sprintf( 'حداقل سفارش محصول 18.000 تومان است' ,
    woocommerce_price( $minimum ),
    woocommerce_price( WC()->cart->total )
    ), 'error'
    );

    }
    }

    }
    ?>
    <?php
    add_action( 'init', 'wc_add_cart_button_for_loop' );
    function wc_add_cart_button_for_loop() {
    add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
    }
    ?>

    فایل فانکشن من

    <?php

    /**

    * Set up the content width value based on the theme's design.

    *

    * @see templatemela_content_width()

    *

    * @since TemplateMela 1.0

    */

    if ( ! isset( $content_width ) ) {

    $content_width = 604;

    }

    function templatemela_setup() {

    /*

    * This theme styles the visual editor to resemble the theme style,

    * specifically font, colors, icons, and column width.

    */

    add_editor_style( array( 'css/font-awesome.css', '/fonts/css/font-awesome.css', templatemela_fonts_url() ) );

    // Adds RSS feed links to <head> for posts and comments.

    add_theme_support( 'automatic-feed-links' );

    /*

    * Switches default core markup for search form, comment form,

    * and comments to output valid HTML5.

    */

    add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list' ) );

    /*

    * This theme supports all available post formats by default.

    * See http://codex.wordpress.org/Post_Formats

    */

    add_theme_support( 'post-formats', array(

    'aside', 'image', 'video', 'audio', 'quote', 'link', 'gallery',

    ) );

    global $wp_version;

    if ( version_compare( $wp_version, '3.4', '>=' ) ) {

    add_theme_support( 'custom-background' );

    }

    // This theme uses wp_nav_menu() in one location.

    register_nav_menus( array(

    'primary' => __( 'TM Header Navigation', 'templatemela' ),

    'header-menu' => __('TM Header Top Links', 'templatemela'),

    'footer-menu' => __('TM Footer Navigation', 'templatemela'),

    ) );

    /*

    * This theme uses a custom image size for featured images, displayed on

    * "standard" posts and pages.

    */

    add_theme_support( 'post-thumbnails' );

    set_post_thumbnail_size( 604, 270, true );

    // This theme uses its own gallery styles.

    add_filter( 'use_default_gallery_style', '__return_false' );

    }

    add_action( 'after_setup_theme', 'templatemela_setup' );

    /*

    * Makes Templatemela available for translation.

    *

    * Translations can be added to the /languages/ directory.

    * If you're building a theme based on Templatemela, use a find and

    * replace to change 'templatemela' to the name of your theme in all

    * template files.

    */

    function templatemela_textdomain_setup() {

    load_theme_textdomain( 'templatemela', get_template_directory() . '/langg' );

    $locale = get_locale();

    $locale_file = get_template_directory() . "/languages/$locale.php";

    if ( is_readable( $locale_file ) ) {

    require_once( $locale_file );

    }

    }

    add_action( 'after_setup_theme', 'templatemela_textdomain_setup' );

    /********************************************************

    **************** TEMPLATE MELA CONTENT WIDTH ******************

    ********************************************************/

    function templatemela_content_width() {

    if ( is_attachment() && wp_attachment_is_image() ) {

    $GLOBALS['content_width'] = 810;

    }

    }

    add_action( 'template_redirect', 'templatemela_content_width' );

    /**

    * Getter function for Featured Content Plugin.

    *

    * @since TemplateMela 1.0

    *

    * @return array An array of WP_Post objects.

    */

    function templatemela_get_featured_posts() {

    /**

    * Filter the featured posts to return in TemplateMela.

    * @param array|bool $posts Array of featured posts, otherwise false.

    */

    return apply_filters( 'templatemela_get_featured_posts', array() );

    }

    /**

    * A helper conditional function that returns a boolean value.

    * @return bool Whether there are featured posts.

    */

    function templatemela_has_featured_posts() {

    return ! is_paged() && (bool) templatemela_get_featured_posts();

    }

    /********************************************************

    **************** TEMPLATE MELA SIDEBAR ******************

    ********************************************************/

    function templatemela_widgets_init() {

    register_sidebar( array(

    'name' => __( 'Main Sidebar', 'templatemela' ),

    'id' => 'sidebar-1',

    'description' => __( 'Appears on posts and pages except the optional Front Page template, which has its own widgets', 'templatemela' ),

    'before_widget' => '<aside id="%1$s" class="widget %2$s">',

    'after_widget' => "</aside>",

    'before_title' => '<h1 class="widget-title">',

    'after_title' => '</h1>',

    ) );

    register_sidebar( array(

    'name' => __( 'Secondary Sidebar', 'templatemela' ),

    'id' => 'sidebar-2',

    'before_widget' => '<aside id="%1$s" class="widget %2$s">',

    'after_widget' => "</li></ul></aside>",

    'before_title' => '<h3 class="widget-title">',

    'after_title' => '</h3><ul class="main-ul"><li>',

    ));

    register_sidebar( array(

    'name' => __( 'Homepage Sidebar', 'templatemela' ),

    'id' => 'sidebar-home',

    'description' => __( 'Appears on posts and pages in Front Page template, which has its own widgets', 'templatemela' ),

    'before_widget' => '<aside id="%1$s" class="widget %2$s">',

    'after_widget' => "</aside>",

    'before_title' => '<h1 class="widget-title">',

    'after_title' => '</h1>',

    ) );

    }

    add_action( 'widgets_init', 'templatemela_widgets_init' );

    /********************************************************

    **************** TEMPLATE MELA FONT SETTING ******************

    ********************************************************/

    function templatemela_fonts_url() {

    $fonts_url = '';

    /* Translators: If there are characters in your language that are not

    * supported by Source Sans Pro, translate this to 'off'. Do not translate

    * into your own language.

    */

    $source_sans_pro = _x( 'on', 'Source Sans Pro font: on or off', 'templatemela' );

    /* Translators: If there are characters in your language that are not

    * supported by Bitter, translate this to 'off'. Do not translate into your

    * own language.

    */

    $bitter = _x( 'on', 'Bitter font: on or off', 'templatemela' );

    if ( 'off' !== $source_sans_pro || 'off' !== $bitter ) {

    $font_families = array();

    if ( 'off' !== $source_sans_pro )

    $font_families[] = 'Source Sans Pro:300,400,700,300italic,400italic,700italic';

    if ( 'off' !== $bitter )

    $font_families[] = 'Bitter:400,700';

    $query_args = array(

    'family' => urlencode( implode( '|', $font_families ) ),

    'subset' => urlencode( 'latin,latin-ext' ),

    );

    $fonts_url = add_query_arg( $query_args, "//fonts.googleapis.com/css" );

    }

    return $fonts_url;

    }

    /********************************************************

    ************ TEMPLATE MELA SCRIPT SETTING ***************

    ********************************************************/

    function templatemela_scripts_styles() {

    // Add Source Sans Pro and Bitter fonts, used in the main stylesheet.

    wp_enqueue_style( 'templatemela-fonts', templatemela_fonts_url(), array(), null );

    // Add Genericons font, used in the main stylesheet.

    wp_enqueue_style( 'font_awesome', get_template_directory_uri() . '/fonts/css/font-awesome.css', array(), '2.09' );

    // Add Genericons font, used in the main stylesheet.

    wp_enqueue_style( 'font', get_template_directory_uri() . '/fonts/ArialRoundedMT.css',array());

    // Loads our main stylesheet.

    wp_enqueue_style( 'templatemela-style', get_stylesheet_uri(), array(), '2014-02-01' );

    /*

    * Adds Javascript to pages with the comment form to support

    * sites with threaded comments (when in use).

    */

    if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {

    wp_enqueue_script( 'comment-reply' );

    }

    if ( is_singular() && wp_attachment_is_image() ) {

    wp_enqueue_script( 'templatemela-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20130402' );

    }

    // Loads Javascript file with functionality specific to Templatemela.

    wp_enqueue_script( 'templatemela-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '2014-02-01', true );

    // Adds Javascript for handling the navigation menu hide-and-show behavior.

    wp_enqueue_script( 'templatemela-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '1.0', true );

    }

    add_action( 'wp_enqueue_scripts', 'templatemela_scripts_styles' );

    /********************************************************

    ************ TEMPLATE MELA ADMIN FONT SETTING ***************

    ********************************************************/

    function templatemela_admin_fonts() {

    wp_enqueue_style( 'templatemela-fonts', templatemela_fonts_url(), array(), null );

    }

    add_action( 'admin_print_scripts-appearance_page_custom-header', 'templatemela_admin_fonts' );

    /********************************************************

    ************ TEMPLATE MELA IMAGE ATTACHMENT ***************

    ********************************************************/

    if ( ! function_exists( 'templatemela_the_attached_image' ) ) :

    /**

    * Print the attached image with a link to the next attached image.

    * @return void

    */

    function templatemela_the_attached_image() {

    /**

    * Filter the image attachment size to use.

    *

    * @since Templatemela 1.0

    *

    * @param array $size {

    * @type int The attachment height in pixels.

    * @type int The attachment width in pixels.

    * }

    */

    $attachment_size = apply_filters( 'templatemela_attachment_size', array( 724, 724 ) );

    $next_attachment_url = wp_get_attachment_url();

    $post = get_post();

    /*

    * Grab the IDs of all the image attachments in a gallery so we can get the URL

    * of the next adjacent image in a gallery, or the first image (if we're

    * looking at the last image in a gallery), or, in a gallery of one, just the

    * link to that image file.

    */

    $attachment_ids = get_posts( array(

    'post_parent' => $post->post_parent,

    'fields' => 'ids',

    'numberposts' => -1,

    'post_status' => 'inherit',

    'post_type' => 'attachment',

    'post_mime_type' => 'image',

    'order' => 'ASC',

    'orderby' => 'menu_order ID'

    ) );

    // If there is more than 1 attachment in a gallery...

    if ( count( $attachment_ids ) > 1 ) {

    foreach ( $attachment_ids as $attachment_id ) {

    if ( $attachment_id == $post->ID ) {

    $next_id = current( $attachment_ids );

    break;

    }

    }

    // get the URL of the next image attachment...

    if ( $next_id )

    $next_attachment_url = get_attachment_link( $next_id );

    // or get the URL of the first image attachment.

    else

    $next_attachment_url = get_attachment_link( array_shift( $attachment_ids ) );

    }

    printf( '<a href="%1$s" title="%2$s" rel="attachment">%3$s</a>',

    esc_url( $next_attachment_url ),

    the_title_attribute( array( 'echo' => false ) ),

    wp_get_attachment_image( $post->ID, $attachment_size )

    );

    }

    endif;

    /********************************************************

    ************ TEMPLATE MELA GET URL **********************

    ********************************************************/

    function templatemela_get_link_url() {

    $content = get_the_content();

    $has_url = get_url_in_content( $content );

    return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink() );

    }

    /********************************************************

    ************ TEMPLATE MELA LIST AUTHOR SETTING**************

    ********************************************************/

    if ( ! function_exists( 'templatemela_list_authors' ) ) :

    /**

    * Print a list of all site contributors who published at least one post.

    * @return void

    */

    function templatemela_list_authors() {

    $contributor_ids = get_users( array(

    'fields' => 'ID',

    'orderby' => 'post_count',

    'order' => 'DESC',

    'who' => 'authors',

    ) );

    foreach ( $contributor_ids as $contributor_id ) :

    $post_count = count_user_posts( $contributor_id );

    // Move on if user has not published a post (yet).

    if ( ! $post_count ) {

    continue;

    }

    ?>

    <div class="contributor">

    <div class="contributor-info">

    <div class="contributor-avatar"><?php echo get_avatar( $contributor_id, 132 ); ?></div>

    <div class="contributor-summary">

    <h2 class="contributor-name"><?php echo get_the_author_meta( 'display_name', $contributor_id ); ?></h2>

    <p class="contributor-bio"> <?php echo get_the_author_meta( 'description', $contributor_id ); ?> </p>

    <a class="contributor-posts-link" href="<?php echo esc_url( get_author_posts_url( $contributor_id ) ); ?>"> <?php printf( _n( '%d Article', '%d Articles', $post_count, 'templatemela' ), $post_count ); ?> </a> </div>

    <!-- .contributor-summary -->

    </div>

    <!-- .contributor-info -->

    </div>

    <!-- .contributor -->

    <?php

    endforeach;

    }

    endif;

    /**

    * Extend the default WordPress body classes.

    *

    * Adds body classes to denote:

    * 1. Single or multiple authors.

    * 2. Presence of header image.

    * 3. Index views.

    * 4. Full-width content layout.

    * 5. Presence of footer widgets.

    * 6. Single views.

    * 7. Featured content layout.

    *

    * @since TemplateMela 1.0

    *

    * @param array $classes A list of existing body class values.

    * @return array The filtered body class list.

    */

    function templatemela_body_classes( $classes ) {

    if ( is_multi_author() ) {

    $classes[] = 'group-blog';

    }

    if ( get_header_image() ) {

    $classes[] = 'header-image';

    } else {

    $classes[] = 'masthead-fixed';

    }

    if ( is_archive() || is_search() || is_home() ) {

    $classes[] = 'list-view';

    }

    if ( ( ! is_active_sidebar( 'sidebar-2' ) )

    || is_page_template( 'page-templates/full-width.php' )

    || is_page_template( 'page-templates/contributors.php' )

    || is_attachment() ) {

    //$classes[] = 'full-width';

    }

    if ( is_singular() && ! is_front_page() ) {

    $classes[] = 'singular';

    }

    if ( is_front_page() && 'slider' == get_theme_mod( 'featured_content_layout' ) ) {

    $classes[] = 'slider';

    } elseif ( is_front_page() ) {

    $classes[] = 'grid';

    }

    return $classes;

    }

    add_filter( 'body_class', 'templatemela_body_classes' );

    /**

    * Extend the default WordPress post classes.

    *

    * Adds a post class to denote:

    * Non-password protected page with a post thumbnail.

    * @param array $classes A list of existing post class values.

    * @return array The filtered post class list.

    */

    function templatemela_post_classes( $classes ) {

    if ( ! post_password_required() && has_post_thumbnail() ) {

    $classes[] = 'has-post-thumbnail';

    }

    return $classes;

    }

    add_filter( 'post_class', 'templatemela_post_classes' );

    /**

    * Create a nicely formatted and more specific title element text for output

    * in head of document, based on current view.

    * @param string $title Default title text for current view.

    * @param string $sep Optional separator.

    * @return string The filtered title.

    */

    function templatemela_wp_title( $title, $sep ) {

    global $paged, $page;

    if ( is_feed() ) {

    return $title;

    }

    // Add the site name.

    $title .= get_bloginfo( 'name' );

    // Add the site description for the home/front page.

    $site_description = get_bloginfo( 'description', 'display' );

    if ( $site_description && ( is_home() || is_front_page() ) ) {

    $title = "$title $sep $site_description";

    }

    // Add a page number if necessary.

    if ( $paged >= 2 || $page >= 2 ) {

    $title = "$title $sep " . sprintf( __( 'Page %s', 'templatemela' ), max( $paged, $page ) );

    }

    return $title;

    }

    add_filter( 'wp_title', 'templatemela_wp_title', 10, 2 );

    // Implement Custom Header features.

    require get_template_directory() . '/inc/custom-header.php';

    // Custom template tags for this theme.

    require get_template_directory() . '/inc/template-tags.php';

    // Add Theme Customizer functionality.

    require get_template_directory() . '/inc/customizer.php';

    /*

    * Add Featured Content functionality.

    *

    * To overwrite in a plugin, define your own Featured_Content class on or

    * before the 'setup_theme' hook.

    */

    if ( ! class_exists( 'Featured_Content' ) && 'plugins.php' !== $GLOBALS['pagenow'] ) {

    require get_template_directory() . '/inc/featured-content.php';

    }

    include_once("templatemela/megnor-functions.php");

    ?>

  12. سلام

    تو قالب من از کد کوتاه کردن عنوان استفاده شده و عنوان را خیلی خلاصه نمایش میده حداکثر 25 کاراکتر.

    حالا هرچی با firebug میگردم گزینه ای پیدا نمیکنم که تعداد کاراکتر ها را افزایش بدم و معمولا فقط 25 کاراکتر برای خلاصه عنوان نمایش میده, میخام تعدادکاراکتر ها را زیاد کنم. لطفا راهنمای کنید.

    xpl2_56.jpg


    .woocommerce ul.products li.product h3,.woocommerce-page ul.products li.product h3 {
    padding: 8px 0 8px;
    margin: 0;
    font-family: 'BYekan', tahoma, Helvetica, sans-serif;
    font-size: 11px;
    text-transform:capitalize;
    direction: rtl;
    }

  13. بفرمایید

    <?php

    /**

    * The main template file

    *

    * This is the most generic template file in a WordPress theme and one

    * of the two required files for a theme (the other being style.css).

    * It is used to display a page when nothing more specific matches a query,

    * e.g., it puts together the home page when no home.php file exists.

    *

    * @link http://codex.wordpress.org/Template_Hierarchy

    *

    * @package WordPress

    * @subpackage TemplateMela

    * @since TemplateMela 1.0

    */

    get_header(); ?>

    <div id="main-content" class="main-content blog-page blog-list <?php echo tm_sidebar_position(); ?>">

    <?php

    if ( is_front_page() && templatemela_has_featured_posts() ) {

    // Include the featured content template.

    get_template_part( 'featured-content' );

    }

    ?>

    <div id="primary" class="content-area">

    <div class="page-title">

    <div class="page-title-inner">

    <h1 class="entry-title-main">

    <?php echo get_the_title( get_option('page_for_posts', true) ); wp_reset_query(); ?>

    </h1>

    <?php templatemela_breadcrumbs(); ?>

    </div>

    </div>

    <div id="content" class="site-content" role="main">

    <?php

    if ( have_posts() ) :

    // Start the Loop.

    while ( have_posts() ) : the_post();

    /*

    * Include the post format-specific template for the content. If you want to

    * use this in a child theme, then include a file called called content-___.php

    * (where ___ is the post format) and that will be used instead.

    */

    get_template_part( 'content', get_post_format() );

    endwhile;

    // Previous/next post navigation.

    templatemela_paging_nav();

    else :

    // If no content, include the "No posts found" template.

    get_template_part( 'content', 'none' );

    endif;

    ?>

    </div>

    <!-- #content -->

    </div>

    <!-- #primary -->

    <?php get_sidebar( 'content' ); ?>

    </div>

    <!-- #main-content -->

    <?php

    get_sidebar();

    get_footer();

    ?>

×
×
  • اضافه کردن...