Jump to content
  • 0

Удалить @media для мобильных устройств


LyalinDV
 Share

Question

Добрый день! Ситуация такая: имеется покупной шаблон, необходимо удалить мою мобильную версию сайта. То есть необходимо сделать так, что бы сайт отображался одинаково во всех устройствах (мне так удобнее). 

 

style.css:

/*Theme Name: AliumTheme URI: [url]http://smthemes.com/alium/[/url]Author: The Smart Magazine ThemesAuthor URI: [url]http://smthemes.com/[/url]Description: Template by SMThemes.comVersion: 2.0License: Creative Commons 3.0Theme date: 10/09/2013License URI: license.txtTags: white, red, light, fixed-width, featured-images, custom-menu, translation-ready, threaded-comments, theme-options*/  /*  -==========================- GENERAL -==========================-  *//*------------------------------ PAGE ------------------------------*/@import url([url]http://fonts.googleapis.com/css?family=Oswald);[/url]@import url(css/font.css);html {    background:url(images/666.jpg) no-repeat fixed;         -webkit-background-size: cover;         -moz-background-size: cover;         -o-background-size: cover;         background-size: cover;}body {    background:url(images/top.png) left top repeat-x;    color:#d6f3ff;      }a {    color:#19b1f6;    text-decoration:none;         }a:hover {    text-decoration:underline;          }h1, h2, h3, h4, h5, h6, a.post_ttl {    color:#d7f2ff;    text-decoration:none;} a.post_ttl {    font-size:20px;              }/*------------------------------ HEADER ------------------------------*/#header {    }#secondarymenu-container {    position:relative;}#smthemes_share {    z-index:10;}/*------------------------------ SEARCH ------------------------------*/#s {    border:none;    background:none;    float:right;    height:25px;    line-height:25px;    color:#a1a1a1;}.searchbtn {    height:27px;    width:37px;    margin-left:0;}.searchform {    background:#f3f3f3;    border:1px solid #fff;    box-shadow:0 0 3px #d8d8d8 inset;}/*------------------------------ CONTENT ------------------------------*/.articles .post-meta {    border-top:2px solid #00699e;    border-bottom:2px solid #00699e;}.articles .post-date {    color:#19b1f6;    font-size:14px;    float:right;}.articles .one-post {     margin-bottom:15px; }#commentform #submit, input.readmore, a.readmore {    color:#fff;    border:1px solid #17a6e7;    border-top:1px solid #6ac6f0;    border-bottom:1px solid #1599d6;    background:#0090d2;    background-image: linear-gradient(bottom, rgb(0,125,197) 0%, rgb(6,161,218) 100%);    background-image: -o-linear-gradient(bottom, rgb(0,125,197) 0%, rgb(6,161,218) 100%);    background-image: -moz-linear-gradient(bottom, rgb(0,125,197) 0%, rgb(6,161,218) 100%);    background-image: -webkit-linear-gradient(bottom, rgb(0,125,197) 0%, rgb(6,161,218) 100%);    background-image: -ms-linear-gradient(bottom, rgb(0,125,197) 0%, rgb(6,161,218) 100%);    background-image: -webkit-gradient( linear, left bottom,    left top,   color-stop(0, rgb(0,125,197)),  color-stop(1, rgb(6,161,218)));    margin-right:5px;}#commentform #submit:hover, input.readmore:hover, a.readmore:hover {    text-decoration:none;    background:#1b6080;    background-image: linear-gradient(bottom, rgb(14,54,72) 0%, rgb(36,126,168) 100%);    background-image: -o-linear-gradient(bottom, rgb(14,54,72) 0%, rgb(36,126,168) 100%);    background-image: -moz-linear-gradient(bottom, rgb(14,54,72) 0%, rgb(36,126,168) 100%);    background-image: -webkit-linear-gradient(bottom, rgb(14,54,72) 0%, rgb(36,126,168) 100%);    background-image: -ms-linear-gradient(bottom, rgb(14,54,72) 0%, rgb(36,126,168) 100%);    background-image: -webkit-gradient( linear, left bottom,    left top,   color-stop(0, rgb(14,54,72)),   color-stop(1, rgb(36,126,168)));}.featured_image {  padding:3px;    background:#fff;    border:1px solid #ccc;    }  a:hover img {    position:relative;    top:-2px;    left:-2px;}.googlemap {    background:#fff;    border:none;}.widget_posts ul li img,.widget_flickr a {    padding:2px;    background:#fff;}.page-numbers {    font-size:14px;    padding:5px 10px;}a.page-numbers {    color:#fff;}a.page-numbers:hover, span.page-numbers {        color:#fff;    background:#0090d2;    background-image: linear-gradient(bottom, rgb(0,125,197) 0%, rgb(6,161,218) 100%);    background-image: -o-linear-gradient(bottom, rgb(0,125,197) 0%, rgb(6,161,218) 100%);    background-image: -moz-linear-gradient(bottom, rgb(0,125,197) 0%, rgb(6,161,218) 100%);    background-image: -webkit-linear-gradient(bottom, rgb(0,125,197) 0%, rgb(6,161,218) 100%);    background-image: -ms-linear-gradient(bottom, rgb(0,125,197) 0%, rgb(6,161,218) 100%);    background-image: -webkit-gradient( linear, left bottom,    left top,   color-stop(0, rgb(0,125,197)),  color-stop(1, rgb(6,161,218)));    border-radius:5px;    -webkit-border-radius:5px;    -moz-border-radius:5px;    } /*------------------------------ FOOTER ------------------------------*/#footer {    color:#d6f3ff;    background:#012144;    background-image: linear-gradient(bottom, rgb(0,25,51) 0%, rgb(1,38,78) 100%);    background-image: -o-linear-gradient(bottom, rgb(0,25,51) 0%, rgb(1,38,78) 100%);    background-image: -moz-linear-gradient(bottom, rgb(0,25,51) 0%, rgb(1,38,78) 100%);    background-image: -webkit-linear-gradient(bottom, rgb(0,25,51) 0%, rgb(1,38,78) 100%);    background-image: -ms-linear-gradient(bottom, rgb(0,25,51) 0%, rgb(1,38,78) 100%);    background-image: -webkit-gradient( linear, left bottom,    left top,   color-stop(0, rgb(0,25,51)),    color-stop(1, rgb(1,38,78)));    border-top:1px solid #024082}#footer-bgr {    background:url(images/footer.png) left top repeat;} #footer a { }#footer h3 { }#footer .footer_txt {    border-top:2px solid #19b1f6;}#footer .footer_txt a {    color:#fff;    text-decoration:underline;} /*------------------------------ WIDGETS AND SLIDER ------------------------------*/#content .widget {    background:url(images/widget.png) left top repeat-y;}#content .widget .caption {    border-top:1px solid #0fdded;    margin:0 -10px;    margin-bottom:10px;    padding:0 10px;    background:#fff;    background-image: linear-gradient(bottom, rgb(5,76,143) 0%, rgb(9,141,193) 100%);    background-image: -o-linear-gradient(bottom, rgb(5,76,143) 0%, rgb(9,141,193) 100%);    background-image: -moz-linear-gradient(bottom, rgb(5,76,143) 0%, rgb(9,141,193) 100%);    background-image: -webkit-linear-gradient(bottom, rgb(5,76,143) 0%, rgb(9,141,193) 100%);    background-image: -ms-linear-gradient(bottom, rgb(5,76,143) 0%, rgb(9,141,193) 100%);    background-image: -webkit-gradient( linear, left bottom,    left top,   color-stop(0, rgb(5,76,143)),   color-stop(1, rgb(9,141,193)));}#content .tabs_captions {    border-top:1px solid #0fdded;    margin:0 -10px;    margin-bottom:10px;    padding:9px 10px;    background:#076faa;    background-image: linear-gradient(bottom, rgb(5,76,143) 0%, rgb(9,141,193) 100%);    background-image: -o-linear-gradient(bottom, rgb(5,76,143) 0%, rgb(9,141,193) 100%);    background-image: -moz-linear-gradient(bottom, rgb(5,76,143) 0%, rgb(9,141,193) 100%);    background-image: -webkit-linear-gradient(bottom, rgb(5,76,143) 0%, rgb(9,141,193) 100%);    background-image: -ms-linear-gradient(bottom, rgb(5,76,143) 0%, rgb(9,141,193) 100%);    background-image: -webkit-gradient( linear, left bottom,    left top,   color-stop(0, rgb(5,76,143)),   color-stop(1, rgb(9,141,193)));}.fp-next, .fp-prev {    width:35px;    height:175px;}/*  -==========================- DESKTOP -==========================-  */@media only screen and (min-width:1024px) {    #header {        background:url(images/menu.png) left 170px repeat-x;    }    #logo {        float:left;        margin-top:40px;    }    .menusearch {        position:absolute;        right:0;        top:50px;        margin-top:18px;    }    /*------------------------------ MENU ------------------------------*/    #secondarymenu-container {        height:170px;        position:relative;        z-index:11;    }    #secondarymenu {        float:right;    }    #secondarymenu li {            }    #secondarymenu a {        color:#0090d2;        text-decoration:none;        padding:13px;        display:block;        font-size:13px;    }    #secondarymenu a:hover{        color:#fff;    }    #mainmenu-container {        height:50px    }        #mainmenu li a {        text-align:center;        color:#fff;        display:block;        text-decoration:none;        font-size:17px;        padding:15px 25px;        border-right:1px solid #023659;        border-left:1px solid #0376b0;    }    #mainmenu a:hover{        background:url(images/menu-li-hover.png) left top repeat-x;    }    #header li ul {        top:50px;    }    #mainmenu li ul {        top:58px;        left:0%;    }          #header li ul .inner {        background:#0090d2;        padding:0;    }    #header ul.children li, #header .sub-menu li {        padding:0 !important;        margin:0 !important;        height:25px;        line-height:25px;    }    #header ul.children li a, #header .sub-menu li a {        color:#fff !important;        padding:0 !important;        background:none;        height:25px;        line-height:25px;    }    #header ul.children li a:hover, #header .sub-menu li a:hover {        background:#195977 !important;        color:#fff !important;    }    #header .sub-menu .sub-menu {        top:0;    }            /*------------------------------ SLIDER ------------------------------*/    .slider-container {        background:url(images/slider.png) left bottom repeat-x;        padding-bottom:7px;        margin-bottom:30px;    }    .slider-shadow-left {        background:url(images/slider-shadow-left.png) left top repeat-y;        position:absolute;        left:0;        top:0;        bottom:0;        width:300px;    }    .slider-shadow-right {        background:url(images/slider-shadow-right.png) right top repeat-y;        position:absolute;        right:0;        top:0;        bottom:0;        width:300px;    }    .slider {            position:relative;        width:1280px;        margin:0 auto;        border:none;    }    .fp-prev-next-wrap {        margin:-15px;    }    .fp-prev,.fp-next {        margin:15px;        margin-top:-32px;    }        .fp-slides,.fp-thumbnail,.fp-slides-items  {            max-width:100%;        height:453px;    }    .fp-content-fon {        border-bottom:none;        border-left:none;        border-right:none;    }    .fp-content-fon, .fp-content {          left:0;        right:0;        bottom:0;    }    .slider-nothumb .fp-content-fon {        background:#fff;    }    .slider-nothumb .fp-content a,.slider-nothumb .fp-content p{        color:#000;    }    .fp-nav {        bottom:25px;        right:30px;        left:auto;    } }@media only screen and (min-width:1024px) and (max-width:1280px) {    .slider {        width:100%;    }} /*  -==========================- TABLET -==========================-  */@media only screen and (min-width:640px) and (max-width:1023px) {        #header .container {        background-position:url(images/555.png) no-repeat fixed;    }    #logo {        float:left;        margin-left:0px;    }    #header-banner {        margin-top:25px;        float:right;    }    /*------------------------------ MENU ------------------------------*/    .menusearch {        position:absolute;        right:20px;        top:50px;        margin-top:18px;    }    #secondarymenu-container {        height:100px;        padding-top:0px;    }    #secondarymenu {        float:right;        clear:right;        margin-top:0px;    }    #secondarymenu li {        padding:13px;    }    #secondarymenu li a{        color:#f8f8f8;    }    #mainmenu-container {        background: #0a97ca; /* Old browsers */        background: -moz-linear-gradient(top,  #0a97ca 0%, #044386 100%); /* FF3.6+ */        background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#0a97ca), color-stop(100%,#044386)); /* Chrome,Safari4+ */        background: -webkit-linear-gradient(top,  #0a97ca 0%,#044386 100%); /* Chrome10+,Safari5.1+ */        background: -o-linear-gradient(top,  #0a97ca 0%,#044386 100%); /* Opera 11.10+ */        background: -ms-linear-gradient(top,  #0a97ca 0%,#044386 100%); /* IE10+ */        background: linear-gradient(to bottom,  #0a97ca 0%,#044386 100%); /* W3C */        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#0a97ca', endColorstr='#044386',GradientType=0 ); /* IE6-9 */         padding-bottom:13px;        clear:left;        padding-bottom:15px;        margin-bottom:15px;    }    #mainmenu {        margin:0 10px;    }    #mainmenu li {        padding:0;        float:left;    }    #mainmenu a {        color:#fff;        text-decoration:none;        font-size:13px;        font-family:'Oswald';        padding:15px 10px 7px;        display:block;    }    #mainmenu li ul {        top:65px;        left:0;    }      #header li ul  .transparent {            }    #header li ul .inner {        margin:1px;    }    #header ul.children li a, #header .sub-menu li a {        color:#686868;        padding:0 !important;        background:none;    }    #header ul.children li a:hover, #header .sub-menu li a:hover {        color:#fff;    }    .slider-container { padding-bottom:35px;}} /*  -==========================- MOBILE -==========================-  */@media only screen and (min-width:240px) and (max-width:639px) {    .menusearch {padding:3px 0;}            #logo {        padding-top:30px;        height:110px;    }         #mainmenu {            margin:0 -2%;        padding:0 2%;        margin-top:10px;    }     #mainmenu li {        border-top:1px solid #eee;    }     #mainmenu li a{        color:#142736;    }    .fp-next, .fp-prev {        margin:0 -5px;    }    .footer-widgets .widgetf:first-child {        border:none;    }        #footer {        width:100%;    }    .widgetf {        border-top:1px solid #d3d3d3;    }    .articles .post-date {        float:none;    }    .articles dt p img {        display:none;    }    .fp-nav {        bottom:-5px;    }    .slider-container {        padding-bottom:20px;    }    #s {        width:70%;        }}
Удалив строки, начиная с /*

-==========================- MOBILE -==========================- */

@media only screen and (min-width:240px) and (max-width:639px) 

Ни к чему не приводит. Для моб. устройств все так же отображается "другая версия" сайта.

В папке CSS есть два файла: mobile.css и tablet.css. Удалял их, результат тот же.

Где же подключается эта функция определения размера экрана?

На всякий случай прикладываю functions.php :

<?php if ( ( $pagenow == "themes.php" ) && current_user_can('administrator') && isset( $_GET['activated'] ) && ( $_GET['activated']=='true' ) ) {    if (!include_once( get_template_directory() . '/inc/activation.php' )) {        $stylesheet = get_option( 'theme_switched' );        switch_theme( $stylesheet, $stylesheet );        if ( file_exists( get_template_directory() . '/inc/activation.php' ) ) {            $error_message[]="PHP hasn't access to file /inc/activation.php. Check the file permissions and try again please.";        } else {            $error_message[]="File /inc/activation.php doesn't exists. Try to upload the theme again.";        }        $message="<h2>The theme wasn't activated by following reasons:</h2><ul><li>".implode("</li><li>",$error_message)."</li></ul>"."Your theme was switched back to ".$stylesheet.".";        wp_die($message,'',array('back_link'=>"/wp-admin/themes.php"));    }}   if (!session_id()) {    session_start();}if (!include_once (get_template_directory()."/inc/library.php") )wp_die("Cannot include file /inc/library.php.");$settingsfile='settings';$defparamsfile="defaults";$default='global|slider|layout|seo|translations';    $rightargs = array(        'before_widget' => '<div class="widget %2$s"><div class="inner">',        'after_widget' => '</div></div>',        'before_title' => '<div class="caption"><h3>',        'after_title' => '</h3></div>'    ); if ( function_exists('register_sidebar') ) {    $sidebar='default';    register_sidebar(array(        'name' => 'Right Sidebar',        'id' => 'right_sidebar',        'description' =>'The right sidebar widget area',        'before_widget' => '<div id="%1$s" class="widget %2$s"><div class="inner">',        'after_widget' => '</div></div>',        'before_title' => '<div class="caption"><h3>',        'after_title' => '</h3></div>'    ));    register_sidebar(array(        'name' => 'Left Sidebar',        'id' => 'left_sidebar',        'description' =>'The left sidebar widget area',        'before_widget' => '<div id="%1$s" class="widget %2$s"><div class="inner">',        'after_widget' => '</div></div>',        'before_title' => '<div class="caption"><h3>',        'after_title' => '</h3></div>'    ));        $$sidebar='bottom';    register_sidebar(array(        'name' => 'Footer 1',        'id' => 'footer_1',        'description' => 'The primary sidebar widget area',        'before_widget' => '<div id="%1$s" class="widget %2$s"><div class="inner">',        'after_widget' => '</div></div>',        'before_title' => '<div class="caption"><h3>',        'after_title' => '</h3></div>'    ));    register_sidebar(array(        'name' => 'Footer 2',        'id' => 'footer_2',        'description' => 'The primary sidebar widget area',        'before_widget' => '<div id="%1$s" class="widget %2$s"><div class="inner">',        'after_widget' => '</div></div>',        'before_title' => '<div class="caption"><h3>',        'after_title' => '</h3></div>'    ));    register_sidebar(array(        'name' => 'Footer 3',        'id' => 'footer_3',        'description' => 'The primary sidebar widget area',        'before_widget' => '<div id="%1$s" class="widget %2$s"><div class="inner">',        'after_widget' => '</div></div>',        'before_title' => '<div class="caption"><h3>',        'after_title' => '</h3></div>'    ));    register_sidebar(array(        'name' => 'Tabs',        'id' => 'tabs_sidebar',        'description' => 'The primary sidebar widget area',        'before_widget' => '<div id="%1$s" class="tab_widget %2$s"><div class="inner">',        'after_widget' => '</div></div>',        'before_title' => '<span class="scaption">',        'after_title' => '</span>'    ));}$settings=$default;$SMTheme=new SMTheme;include_once get_template_directory()."/inc/widgets/facebook.php";include_once get_template_directory()."/inc/widgets/banners.php";include_once get_template_directory()."/inc/widgets/comments.php";include_once get_template_directory()."/inc/widgets/posts.php";include_once get_template_directory()."/inc/widgets/social-profiles.php";include_once get_template_directory()."/inc/widgets/video.php";include_once get_template_directory()."/inc/widgets/flickr.php";include_once get_template_directory()."/inc/widgets/tabs.php";if ($_SESSION['commentinput']=='') {    $_SESSION['commentinput']=substr(md5(rand(1,234234)),0,5);}if (isset($_POST[$_SESSION['commentinput']])) {    $_POST['comment']=$_POST[$_SESSION['commentinput']];}if (function_exists('add_theme_support')) {    add_theme_support('automatic-feed-links');    add_theme_support('menus');    add_theme_support( 'post-thumbnails' );     set_post_thumbnail_size( $SMTheme->get( 'layout', 'imgwidth' ), $SMTheme->get( 'layout', 'imgheight' ) , true );} if ( function_exists( 'register_nav_menu' ) ) {    register_nav_menu( 'sec-menu', 'Top Menu' );    register_nav_menu( 'main-menu', 'Main Menu' );        }     if ( current_user_can('administrator') ) {        include_once (get_template_directory()."/inc/administrator.php");        $APage = new AdminPage();    }      $SMTheme->prepare_func('right_sidebar', 'show_right_sidebar_widgets');    $SMTheme->prepare_func('footer_1', 'show_footer_1_widgets');    $SMTheme->prepare_func('footer_2', 'show_footer_2_widgets');    $SMTheme->prepare_func('footer_3', 'show_footer_3_widgets');    $SMTheme->prepare_func('tabs_sidebar', 'show_tabs_sidebar_widgets');                function show_tabs_sidebar_widgets() {        $rightargs=array( 'before_widget' => '<div class="tab_widget widget_categories"><div class="inner">',        'after_widget' => '</div></div>',        'before_title' => '<span class="tab_caption">',        'after_title' => '</span>');        $instance['hierarchical']='1';        the_widget('WP_Widget_Categories', $instance, $rightargs);        $rightargs=array( 'before_widget' => '<div class="tab_widget widget_recent_entries"><div class="inner">',        'after_widget' => '</div></div>',        'before_title' => '<span class="tab_caption">',        'after_title' => '</span>');        unset($instance);        the_widget('WP_Widget_Recent_Posts', $instance, $rightargs);    }        function show_right_sidebar_widgets() {        global $rightargs;        $rightargs['before_widget'] = '<div class="widget widget_search"><div class="inner">';        the_widget('WP_Widget_Search', $instance, $rightargs);        $rightargs['before_widget'] = '<div class="widget widget_posts"><div class="inner">';        $instance['display_featured_image']=1;        $instance['title']='Recent Posts';        $instance['display_title']=1;        $instance['excerpt_length']=120;        the_widget('Posts', $instance, $rightargs);        $rightargs['before_widget'] = '<div class="widget widget_comments"><div class="inner">';        $instance = array(            'title' => 'Recent Comments',            'comments_number' => '5',            'display_author' => 'true',            'display_comment' => 'true',            'display_avatar' => 'true',            'read_more_text' => '»',            'comment_length' => '26',            'avatar_size' => '32',            'avatar_align' => 'alignleft'        );        the_widget('Comments', $instance, $rightargs);        unset($instance);        $instance = array(        'width' =>'272',        'title' => 'Video',        'videos' => array(                array(                    'title' => 'The Mountain',                     'url' => 'http://vimeo.com/22439234/',                     'type' => 'vimeo',                     'videoid' => '22439234'                ),                array(                    'title' => 'Amazing nature scenery',                     'url' => 'http://www.youtube.com/watch?v=6v2L2UGZJAM',                     'type' => 'youtube',                     'videoid' => '6v2L2UGZJAM'                )            )        );        $rightargs['before_widget'] = '<div class="widget widget_video"><div class="inner">';        the_widget('VideoFeed', $instance, $rightargs);        unset($instance);        $rightargs['before_widget'] = '<div class="widget widget_banners"><div class="inner">';        $instance = array(            'randomize' => '',            'count' => '3',            'title' => '',            'banners' => array(                '<a href="#"><img src="' . get_template_directory_uri()   . '/images/smt/banner260.gif" alt="" title="" /></a>',                '<a href="#"><img src="' . get_template_directory_uri()   . '/images/smt/banner125.gif" alt="" title="" /></a>',                '<a href="#"><img src="' . get_template_directory_uri()   . '/images/smt/banner125.gif" alt="" title="" /></a>'            )        );        the_widget('Banners', $instance, $rightargs);        unset($instance);        $instance = array(            'title' => 'Flickr',            'userid' => '80789124@N02',            'width' => '55'        );        $rightargs['before_widget'] = '<div class="widget widget_flickr"><div class="inner">';        the_widget('Flickr', $instance, $rightargs);        unset($instance);        $rightargs['before_widget'] = '<div class="widget widget_tag_cloud"><div class="inner">';        the_widget('WP_Widget_Tag_Cloud', $instance, $rightargs);        $instance = array(            'effect' => 'fadeIn'        );        $rightargs['before_widget'] = '<div class="widget widget_tabs"><div class="inner">';        the_widget('Tabs', $instance, $rightargs);        $instance = array(            'title' => 'Calendar'        );        $rightargs['before_widget'] = '<div class="widget widget_calendar"><div class="inner">';        the_widget('WP_Widget_Calendar', $instance, $rightargs);    }    function show_footer_1_widgets() {        $instance = array(            'title' => 'Calendar'        );        $footerargs['before_widget'] = '<div class="widget_calendar">';        the_widget('WP_Widget_Calendar', $instance, $footerargs);            }    function show_footer_2_widgets() {        global $rightargs;        the_widget('WP_Widget_Tag_Cloud', $instance, $rightargs);    }    function show_footer_3_widgets() {        global $rightargs;        $instance= array(            'width' =>'32',            'title' => 'Social Profiles',            'profiles' => array(            array('id'=>'twitter', 'title' => 'Twitter', 'url' => 'http://twitter.com/', 'button' => get_template_directory_uri() . '/images/social-profiles/twitter.png'),            array('id'=>'facebook','title' => 'Facebook', 'url' => 'http://facebook.com/', 'button' => get_template_directory_uri() . '/images/social-profiles/facebook.png'),            array('id'=>'gplus','title' => 'Google Plus', 'url' => 'https://plus.google.com/', 'button' => get_template_directory_uri() . '/images/social-profiles/gplus.png'),            array('id'=>'linkedin','title' => 'LinkedIn', 'url' => 'http://www.linkedin.com/', 'button' => get_template_directory_uri() . '/images/social-profiles/linkedin.png'),            array('id'=>'email','title' => 'Email', 'url' => 'mailto:your@email.com', 'button' => get_template_directory_uri() . '/images/social-profiles/email.png')            )        );        $rightargs['before_widget'] = '<div class="widget widget_social_profiles"><div class="inner">';        the_widget('SocialProfiles', $instance, $rightargs);        $rightargs['before_widget'] = '<div class="widget"><div class="inner">';        unset($instance);        $instance['title']='SMThemes';        $instance['text']='Smart free Wordpress themes on SMT Framework';        the_widget('WP_Widget_Text', $instance, $rightargs);            }        function smtheme_excerpt($args='', $postid=''){        global $post, $SMTheme;            if ((int)$postid==0)$p=$post;            else $p=get_post($postid);            parse_str($args, $i);            $echo = isset($i['echo'])?true:false;            if ( isset($i['maxchar']) ) {                $maxchar=(int)trim($i['maxchar']);                $content = $p->post_content;                $content = apply_filters('the_content', $content);            } else {                if ( $p->post_excerpt ) {                    $content = $p->post_excerpt;                } else {                    $content = $p->post_content;                    $content = apply_filters('the_content', $content);                    $maxchar=($SMTheme->get( 'layout','cuttxton' ))?$SMTheme->get( 'layout','cuttxt' ):0;                    $maxchar=(strpos($content, '<!--more-->'))?strpos(preg_replace('/<.*?>/', '', preg_replace('/<!--more-->/','@smt_readmore_tag',$content)), '@smt_readmore_tag'):$maxchar;                }            }            if (!$maxchar||strlen(preg_replace('/<.*?>/', '', $content)) <= $maxchar) {                if ($echo) print $content;                else return $content;            } else {                preg_match_all('/(<.+?>)?([^<>]*)/s', $content, $lines, PREG_SET_ORDER);                $total_length=0;                $open_tags = array();                $truncate = '';                foreach ($lines as $line_matchings) {                    if (!empty($line_matchings[1])) {                        if (preg_match('/^<(\s*.+?\/\s*|\s*(img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param)(\s.+?)?)>$/is', $line_matchings[1])) {                        } else if (preg_match('/^<\s*\/([^\s]+?)\s*>$/s', $line_matchings[1], $tag_matchings)) {                            $pos = array_search($tag_matchings[1], $open_tags);                            if ($pos !== false) {                                unset($open_tags[$pos]);                            }                        } else if (preg_match('/^<\s*([^\s>!]+).*?>$/s', $line_matchings[1], $tag_matchings)) {                            array_unshift($open_tags, strtolower($tag_matchings[1]));                        }                        $truncate .= $line_matchings[1];                    }                    $content_length = strlen(preg_replace('/&[0-9a-z]{2,8};|[0-9]{1,7};|[0-9a-f]{1,6};/i', ' ', $line_matchings[2]));                                        if ($total_length+$content_length > $maxchar) {                                                $left = $maxchar - $total_length;                        $entities_length = 0;                        if (preg_match_all('/&[0-9a-z]{2,8};|[0-9]{1,7};|[0-9a-f]{1,6};/i', $line_matchings[2], $entities, PREG_OFFSET_CAPTURE)) {                            foreach ($entities[0] as $entity) {                                if ($entity[1]+1-$entities_length <= $left) {                                    $left--;                                    $entities_length += strlen($entity[0]);                                } else {                                    break;                                }                            }                        }                        $truncate .= preg_replace('/(.*)\.[^\.]*$/s', "$1",mb_substr($line_matchings[2], 0, $left+$entities_length, 'utf-8'))."...";                        break;                    } else {                        $truncate .= $line_matchings[2];                        $total_length += $content_length;                    }                    if($total_length>= $maxchar) {                        break;                    }                }                                foreach ($open_tags as $tag) {                    $truncate .= '</' . $tag . '>';                }                $truncate=preg_replace('/<p([^>])*>( )?<\/p>/', '', $truncate);                if ($echo) return print $truncate;                else return $truncate;            }        return;    }      function smt_menu($a) {        $a=preg_replace("/<ul\sclass='children'>/", "<ul class='children'$2><div class='transparent'></div><div class='inner'>", $a);        $a=preg_replace('/<ul\sclass="sub-menu">/', "<ul class='sub-menu'><div class='transparent'></div><div class='inner'>", $a);        $a=preg_replace("/<\/ul>/", "</div></ul>", $a);        return $a;    }    add_filter('wp_list_categories', 'smt_menu');    add_filter('wp_list_pages', 'smt_menu');    add_filter('wp_nav_menu_items', 'smt_menu');    function block_main_menu() {    global $SMTheme;        ?>         <div class="menu-primary-container">            <ul class="menus menu-primary">                <li <?php if(is_home() || is_front_page()) { ?>class="current_page_item"<?php } ?>><a href="<?php echo home_url(); ?>/"><?php echo $SMTheme->_(  'homelink' );?></a></li>                <?php wp_list_categories('title_li=&'); ?>            </ul>        </div>        <?php    }        function block_sec_menu() {        ?><div class='menu-topmenu-container'><ul class="menus">                <?php wp_list_pages('title_li=&'); ?>            </ul></div>        <?php    }    function block_sec_menu_mobile() {        ?>        <script>            jQuery(document).ready(function(){                jQuery('.menu-topmenu-container li').each(function() {                    jQuery('<option />', {                    'value':jQuery(this).find('a').attr('href'),                    'text':jQuery(this).find('a').html()                    }).appendTo(jQuery('#mobile-sec-menu'));                });            });        </script>        <?php    }    function block_main_menu_mobile() {        ?>        <script>            jQuery(document).ready(function(){                jQuery('.menu-primary li').each(function() {                    jQuery('<option />', {                    'value':jQuery(this).find('a').attr('href'),                    'text':jQuery(this).find('a').html()                    }).appendTo(jQuery('#mobile-main-menu'));                });            });        </script>        <?php    }        function smt_mobile_menu($menu_name) {        echo '<select class=\'mobile-menu\' id=\'mobile-'.$menu_name.'\'>';        echo '<option value=\'#\'>Go to ...</option>';         if ( ( $locations = get_nav_menu_locations() ) && isset( $locations[ $menu_name ] ) ) {            $menu = wp_get_nav_menu_object( $locations[ $menu_name ] );            if ($menu_items = wp_get_nav_menu_items($menu->term_id)) {                $sub=array();                foreach ($menu_items as $key => $menu_item ) {                    if ($menu_item->menu_item_parent==0) $sub[$menu_item->ID]=''; else $sub[$menu_item->ID]=$sub[$menu_item->menu_item_parent].'- ';                    echo '<option value=\''.$menu_item->url . '\'>' .$sub[$menu_item->ID]. $menu_item->title . '</option>';                }            } else {                $func='block_'.preg_replace('/-/', '_', $menu_name).'_mobile';                if (is_callable($func)) {                    $func();                }            }        } else {            $func='block_'.preg_replace('/-/', '_', $menu_name).'_mobile';            if (is_callable($func)) {                $func();            }        }        echo '</select>';    }                        function addGMap($atts, $content = null) {         extract(shortcode_atts(array( "addr" => '', "mzoom" => '16' ), $atts));        $id='map_canvas'.mktime().rand(0,1000);        return "        <div class='googlemap'><div id='".$id."' style='width: 100%; height: 300px;'></div></div>        <script>jQuery(function(){loadGMap('".$addr."', '".$id."', ".$mzoom.", '".$content."')});</script>        "; }add_shortcode('gmap', 'addGMap');     function addYouTube($atts, $content = null) {        extract(shortcode_atts(array( "id" => '' ), $atts));        return '<p style="text-align:center;display:block;overflow:hidden;clear:left">        <a href="http://www.youtube.com/watch?v='.$id.'" target="_blank" alt="'.$id.'" class="youtube">        <img src="http://img.youtube.com/vi/'.$id.'/0.jpg" width="90%" height="" />        </a></p><script>loadYouTube();</script>';}add_shortcode('youtube', 'addYouTube'); function addVimeo($atts, $content = null) {        extract(shortcode_atts(array( "id" => '' ), $atts));        $videoinf = unserialize(file_get_contents("http://vimeo.com/api/v2/video/".$id.".php"));        return '<p style="text-align:center;display:block;overflow:hidden;">        <a href="http://vimeo.com/'.$id.'" target="_blank" alt="'.$id.'" class="vimeo">        <img alt="" src="'.$videoinf[0]['thumbnail_large'].'" width="90%">        </a></p><script>loadVimeo();</script>';}add_shortcode('vimeo', 'addVimeo'); function addTooltips($atts, $content = "") {        extract(shortcode_atts(array( "tiptext" => '' ), $atts));        return '<span class="tooltip" title="'.$tiptext.'">'.$content.'<span>'.$tiptext.'</span></span>';}add_shortcode('tooltip', 'addTooltips'); function add_smpanel() {   if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') )     return;   if ( get_user_option('rich_editing') == 'true') {     add_filter('mce_external_plugins', 'add_smpanel_tinymce_plugin');     add_filter('mce_buttons_3', 'register_smpanel');   }} add_action('init', 'add_smpanel');function register_smpanel($buttons) {   array_push($buttons, "youtube","vimeo","|","btns","cols","tooltips","highlights", "gmap");   return $buttons;} function add_smpanel_tinymce_plugin($plugin_array) {   $plugin_array['smpanel'] = get_template_directory_uri() .'/js/editor_plugin.js';   return $plugin_array;} function my_refresh_mce($ver) {  $ver += 3;  return $ver;}add_editor_style( 'css/editor.css' );add_filter( 'tiny_mce_version', 'my_refresh_mce');    if ( ! function_exists('tdav_css') ) {    function tdav_css($wp) {        $wp .= ','.get_template_directory_uri().'/css/shortcode.css ';    return $wp;    }}add_filter( 'mce_css', 'tdav_css' );function smtheme_topic_count_text($count) {    global $SMTheme;    return sprintf( _n($SMTheme->_( 'altposts' ), $SMTheme->_( 'altpostss' ), $count), number_format_i18n( $count ) );}function smtheme_tag_cloud() {    $args['topic_count_text_callback']='smtheme_topic_count_text';    return $args;}add_filter('widget_tag_cloud_args', 'smtheme_tag_cloud'); add_filter( 'gettext', 'theme_change_comment_field_names', 20, 3 );/** * Change comment form default field names. * * @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext */function theme_change_comment_field_names( $translated_text, $text, $domain ) {global $SMTheme;        switch ( $translated_text ) {             case 'View all posts filed under %s' :                 $translated_text = $SMTheme->_( 'altcats' );                break;         }    return $translated_text;}   add_action('admin_init', 'single_content_layout', 1);  function single_content_layout() {      add_meta_box( 'single_content_layout', 'Content layout', 'single_content_layout_func', 'post', 'side', 'high'  );      add_meta_box( 'single_content_layout', 'Content layout', 'single_content_layout_func', 'page', 'side', 'high'  );  } function single_content_layout_func($post) {    global $APage;                $layouts=$APage->PageOptions['layout']['content']['pagelayout']['params'];        $selected = get_post_meta($post->ID, 'single_layout', 1);    ?>        <select name='single_layout' style='width:100%'>            <option value='0'>Default</option>            <?php                        foreach ( $layouts as $key=>$value ) {                echo "<option value='".$key."' ".selected( $selected, $key ).">".$value."</option>";            }            ?>        </select>    <?php} add_action('save_post', 'single_content_layout_update', 0);  function single_content_layout_update( $post_id ){          if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE  ) return false;         if ( !current_user_can('edit_post', $post_id) ) return false;         if( !isset($_POST['single_layout']) ) return false;        $_POST['single_layout'] = (int)$_POST['single_layout'];    update_post_meta($post_id, 'single_layout', $_POST['single_layout']);            return $post_id;  }   ?>
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy