Как убрать ссылку с футера?

(Ответов: 9, Просмотров: 2112)
  1. Дипломник
    • Регистрация: 01.02.2013
    • Сообщений: 103
    • Репутация: 13
    • Webmoney BL: ?
    Пересмотрел кучу видео, перелопатил кучу сайтов, там про закодированные или простые ссылки.
    А у меня другая проблема, удаляю ссылку с футера, а страница отображается так же, если ссылка стоит.
    Удалял все с футера, та же ситуация.

    Вот functions.php
    PHP код:
    <?php 

    /* include all functions */
    foreach ( globget_template_directory() . "/includes/*.php") as $filename) {
        include( 
    $filename );
    }


    $upload_dir wp_upload_dir();
    /*
     * wp-content/uploads is writable and admin page was called at least once = created static css file exists:
     */
    if( is_file$upload_dir['basedir'] . '/montezuma/style.css' ) ) {
        
    $bfa_css '<link rel="stylesheet" type="text/css" media="all" href="' $upload_dir['baseurl'] . '/montezuma/style.css" />';
    /*
     * Fallback: wp-content/uploads not writable or CSS file in wp-uploads not created yet 
     * (The Montezuma admin must be visited at least once for this). 
     */
    } else {
        
    $bfa_css '
    /*************************************************************************
    Default CSS served INLINE because wp-content/uploads is not writable.
    This will change once wp-content/uploads is writable
    **************************************************************************/
    '
    ;
        
    $bfa_css .= implode''fileget_template_directory() . "/admin/default-templates/css/grids/resp12-px-m0px.css" ) );
        foreach ( 
    globget_template_directory() . "/admin/default-templates/css/*.css") as $filename) {
            
    $bfa_css .= implode''file$filename ) );
        }
        
    $bfa_css str_replace'%tpldir%'get_template_directory_uri(), $bfa_css );
        
    $bfa_css "\n<style type='text/css'>\n" $bfa_css "</style>\n";
    }


    /* Enqueuing script with IE *version* condition currently not possible 
     * [url]http://core.trac.wordpress.org/ticket/16024[/url]
     * I would print this inline into head.php like Tyenty-twelve but doing it like this to avoid theme review issue
     */
    add_action'wp_head''bfa_add_inline_scripts_head' );
    function 
    bfa_add_inline_scripts_head() {
        global 
    $is_IE; if( $is_IE ): ?>
    <!--[if lt IE 9]>
    <script src="<?php echo get_template_directory_uri(); ?>/javascript/html5.js" type="text/javascript"></script>
    <script src="<?php echo get_template_directory_uri(); ?>/javascript/css3-mediaqueries.js" type="text/javascript"></script>
    <![endif]-->
    <?php endif; 
    }



    /*************************************************************************
    JAVASCRIPT for FRONTEND
    **************************************************************************/
    add_action('wp_enqueue_scripts''bfa_enqueue_scripts'); 
    function 
    bfa_enqueue_scripts() {

        global 
    $montezuma$upload_dir$post;

        if ( 
    is_singular() && comments_open() && get_option'thread_comments' ) )
            
    wp_enqueue_script'comment-reply' );
        
        
    // Check if gallery page
        
    $is_gallery 0;
        if( 
    is_object$post ) && strpos$post->post_content,'[gallery' ) !== false // check if $post is set on error page
             
    $is_gallery 1;
        
        
    $enqu_list = array( 'jquery' );

        
    // Load jquery-ui-core through dependencies, direct wp_enqueue_script('jquery-ui-core') may be broken
        // [url]http://wordpress.org/support/topic/wp_enqueue_script-with-jquery-ui-and-tabs[/url]
        // ui-core, ui-.widget and effects-core needed by smooth-menu
        
    $enqu_list[] = 'jquery-ui-core';
        
    $enqu_list[] = 'jquery-ui-widget';
        
    $enqu_list[] = 'jquery-effects-core';
                
        if ( 
    is_singular() && $montezuma['comment_quicktags'] != '' 
            
    $enqu_list[] = 'quicktags';

        if( 
    $is_gallery === ) {
            
    wp_register_script'colorbox'get_template_directory_uri() . '/javascript/jquery.colorbox-min.js', array( 'jquery' ) ); 
            
    $enqu_list[] = 'colorbox';
        }
        
        
    wp_register_script'smooth-menu'get_template_directory_uri() . '/javascript/smooth-menu.js', array( 'jquery' ) ); 
        
    $enqu_list[] = 'smooth-menu';

        
        
    // Premade javascript file if uploads not writable, i.e. first use or WP.org theme viewer:
        
    if( is_file$upload_dir['basedir'] . '/montezuma/javascript.js' ) )
            
    $bfa_base_js_enqueue_url $upload_dir['baseurl'] . '/montezuma/javascript.js';
        else 
            
    $bfa_base_js_enqueue_url get_template_directory_uri() . '/admin/default-templates/javascript/javascript.js';
        
        
    wp_enqueue_script'montezuma-js'$bfa_base_js_enqueue_url$enqu_list );

        
    // wp_enqueue_script('masonry', get_template_directory_uri() . '/javascript/masonry.js');
        // wp_enqueue_script('IE9-html5', get_template_directory_uri() . '/js/ie7/IE8.js'); /* <- JS error in FF? */
        // wp_enqueue_script('css3-mediaqueries', get_template_directory_uri() . '/js/css3-mediaqueries.js');
    }    




    // [url]http://wordpress.stackexchange.com/questions/24851/wp-enqueue-inline-script-due-to-dependancies[/url]
    add_action'wp_footer''bfa_print_footer_scripts' );
    if( ! 
    function_exists'bfa_print_footer_scripts' ) ):
        function 
    bfa_print_footer_scripts() {
            global 
    $montezuma;
            if ( 
    $montezuma['comment_quicktags'] != '' && wp_script_is'jquery''done' ) && is_singular() ) {
            
    ?>
    <script type="text/javascript">quicktags({ id: 'comment-form', buttons: '<?php echo $montezuma['comment_quicktags']; ?>' });</script>
            <?php
            
    }
        }
    endif;



    // Remove rel attribute for w3c validator
    #add_filter( 'attachment_link', 'bfa_remove_rel_attr', 10, 2 );
    function bfa_remove_rel_attr$link$id ) {
        
    $link preg_replace'/ rel="(.*?)"/i'''$link );
        return 
    $link;
    }
    #add_filter( 'wp_get_attachment_thumb_URL', 'bfa_remove_rel_attr', 10, 2 );



    function bfa_wp_title$title$sep ) {
        global 
    $paged$page;
        
        if ( 
    is_feed() )
            return 
    $title;

        
    // Add the blog name.
        
    $title .= get_bloginfo'name' );

        
    // Add the blog 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 >= || $page >= )
            
    $title "$title $sep " sprintf__'Page %s''montezuma' ), max$paged$page ) );
        
        return 
    $title;
    }
    add_filter'wp_title''bfa_wp_title'10);



    /*************************************************************************
    THEME OPTIONS
    new ThemeOptions( $title, $id, $path )
    $path = path to directory of section files containing arrays of option fields
    **************************************************************************/
    if( is_admin() )  {
         new 
    ThemeOptions'Montezuma Options''montezuma'get_template_directory() . '/admin/options' );

    $montezuma get_option'montezuma' );



    # Not used anymore
    #$montezumafilecheck = get_option( 'montezumafilecheck' );

    /**
     * Redirect users to Theme Options after activation, this will also create the 
     * CSS file in the uploads dir, for the first time
     */
    if ( is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php" )
        
    wp_redirect'themes.php?page=montezuma' );
        



    if( 
    $montezuma['wlwmanifest_link'] != remove_action('wp_head''wlwmanifest_link');
    if( 
    $montezuma['rsd_link'] != remove_action('wp_head''rsd_link');
    if( 
    $montezuma['wp_generator'] != remove_action('wp_head''wp_generator');
    if( 
    $montezuma['feed_links_extra'] != remove_action'wp_head''feed_links_extra');
    if( 
    $montezuma['feed_links'] != remove_action'wp_head''feed_links'); 
    if( 
    $montezuma['adjacent_posts_rel_link_wp_head'] != remove_action('wp_head''adjacent_posts_rel_link_wp_head'100);


        
    // Not used anymore. Would allow to upload .php files to WP upload directory
    /*
    function bfa_add_php_to_upload_mimes( $existing_mimes=array() ) {
        $existing_mimes['php'] = 'application/x-php';
        return $existing_mimes;
    }
    add_filter( 'upload_mimes', 'bfa_add_php_to_upload_mimes' );    
    */
        
        
    // Add category list below "Blog" page item, in page menu 
    if ( ! function_exists'bfa_add_blog_cats_to_menu' ) ):
    function 
    bfa_add_blog_cats_to_menu($str) {
        
    $cats wp_list_categories('title_li=&echo=0');
        
    $title get_the_title(get_option('page_for_posts'));
        return 
    str_replace('">'.$title.'</a>''">'.$title.'</a><ul>'.$cats.'</ul>'$str);
    }
    endif;
    # add_filter('wp_list_pages', 'bfa_add_blog_cats_to_menu', 1);



    // Theme setup
    if ( ! function_exists'montezuma_setup' ) ):
    function 
    montezuma_setup() {

        if ( ! isset( 
    $content_width ) )
        
    $content_width 640;

        
    load_theme_textdomain'montezuma'get_template_directory() . '/languages' );

        
    // Add all 9 WP post formats
        
    add_theme_support'post-formats', array( 'aside''audio''chat''gallery''image''link''quote''status''video' ) );
        
    add_theme_support"post-thumbnails" );
        
    // set_post_thumbnail_size( 320, 180, true );
        
    add_theme_support("automatic-feed-links");
        
    register_nav_menus( array( "menu1" => __"Menu 1""montezuma" ), "menu2" => __"Menu 2""montezuma" ) ) );
    }
    endif;
    add_action'after_setup_theme''montezuma_setup' );



    ####### Link post thumbs to post, not to full size image #####
    function bfa_link_post_thumbnails_to_post$html$post_id$post_image_id ) {
        
    /*
        $html = '<a href="' . get_permalink( $post_id ) . '" title="' . 
            esc_attr( get_post_field( 'post_title', $post_id ) ) . '">' . $html . '</a>';
        */
        
    $html str_replace('width="320" height="180" '''$html);
        return 
    $html;
    }
    add_filter'post_thumbnail_html''bfa_link_post_thumbnails_to_post'10);




    /*
    // Add custom widgets
    add_action( 'widgets_init', function() {
         return register_widget( 'ATA_Widget_Meta' );
    });
    */


    if( ! function_exists'bfa_comments_allowedtags' ) ) :
    function 
    bfa_comments_allowedtags$data ) {
        global 
    $allowedtags$montezuma

        
    $availabletags = array(
            
    'a' => array( 'href' => true'title' => true ),
            
    'abbr' => array( 'title' => true ),
            
    'acronym' => array( 'title' => true ),
            
    'b' => array(),
            
    'blockquote' => array( 'cite' => true ),
            
    'br' => array(),
            
    'cite' => array(),
            
    'code' => array(),
            
    'del' => array( 'datetime' => true ),
            
    'dd' => array(),
            
    'dl' => array(),
            
    'dt' => array(),
            
    'em' => array (), 'i' => array (),
            
    'ins' => array('datetime' => array(), 'cite' => array()),
            
    'li' => array(),
            
    'ol' => array(),
            
    'p' => array(),
            
    'q' => array( 'cite' => true ),
            
    'strike' => array(),
            
    'strong' => array(),
            
    'sub' => array(),
            
    'sup' => array(),
            
    'u' => array(),
            
    'ul' => array(),
        );
        
    $allowednow = array();
        
        foreach( 
    $montezuma['comment_allowed_tags'] as $tag 
            
    $allowednow[$tag] = $availabletags[$tag];

        
    $allowedtags $allowednow;
        return 
    $data;
    }
    endif;
    add_filter'preprocess_comment''bfa_comments_allowedtags' );



    /* filter tagcloud */
    if( ! function_exists'bfa_filter_tag_cloud' ) ) :
    function 
    bfa_filter_tag_cloud$tags ) {
        
    $tags preg_replace_callback("|(class='tag-link-[0-9]+)('.*?)(style='font-size: )(.*?)(pt;')|",
            
    create_function(
                
    '$match',
                
    '$low=1; $high=5; $sz=round(($match[4]-8.0)/(22-8)*($high-$low)+$low); return "{$match[1]} tagsize-{$sz}{$match[2]}";'
            
    ),
            
    $tags);
        return 
    $tags;
    }
    endif;
    add_action('wp_tag_cloud''bfa_filter_tag_cloud');



    function 
    bfa_buffer_callback$buffer ) {
      
    $buffer str_replace
            array( 
    'http://wp331.testing.com'"\t""</a>\n</li>""</ul>\n</li>" ),
            array( 
    '''''</a></li>''</ul></li>' ),
            
    $buffer 
        
    );
      return 
    $buffer;
    }
    function 
    bfa_buffer_start() { 
        
    ob_start'bfa_buffer_callback' ); 
    }
    function 
    bfa_buffer_end() { 
        
    ob_end_flush(); 
    }
    #add_action('wp_head', 'bfa_buffer_start');
    #add_action('wp_footer', 'bfa_buffer_end');



    // Change default Excerpt Length to custom length:

    function bfa_excerpt_length$length ) { 
        return 
    55;
    }
    add_filter'excerpt_length''bfa_excerpt_length' );


    // Build custom Read More link, used for both auto and manual excerpts
    function bfa_read_more_link() {
        return 
    str_replace
            array( 
    '%title%''%url%' ), 
            array( 
    the_title''''FALSE ), esc_urlget_permalink() ) ), 
            
    // ' <strong>... continue reading &raquo;</strong> <a href="%url%">%title%</a>' 
            
    ' ...<a class="post-readmore" href="%url%">' __'read more''montezuma' ) . '</a>' 
        
    );
    }


    // Replace default Read More link with custom one:
    function bfa_excerpt_more$more ) {
        return 
    bfa_read_more_link();
    }
    add_filter'excerpt_more''bfa_excerpt_more' );


    // Add custom Read More link to manual excerpts:
    function bfa_custom_excerpt_more$output ) {
        if ( 
    has_excerpt() && ! is_attachment() ) 
            
    $output .= bfa_read_more_link();
        return 
    $output;
    }
    add_filter'get_the_excerpt''bfa_custom_excerpt_more' );



    function 
    bfa_include_file$file_group$file_name ) {

        global 
    $montezumafilecheck$upload_dir;
        
        
    $time_start microtime(true); // Start timer
        
    $file trailingslashit$upload_dir['basedir'] ) . "montezuma/$file_name.php";

        if( ! 
    file_exists$file ) ) { // Edited file doesn't exist
            
    include trailingslashitget_template_directory() ) . "$file_group/$file_name.php";
        } else {
            
    extract$montezumafilecheck['files'][$file_group][$file_name] ); // Get file info: $time, $size, $md5:
            
            // Edited file exists. These checks should take around 5 ms on an average web server:
            
    $filetime filemtime$file );
            
    $filesize filesize$file );
            
    $filemd5 md5_file$file );

            
    // Include file only if live info matches with saved info:
            
    if( $time == $filetime && $size == $filesize && $filemd5 == $md5 ) {
                include 
    trailingslashit$upload_dir['basedir'] ) . "montezuma/$file_name.php";
            }

            
    $time_end microtime(true); // Stop timer
            
    $time $time_end $time_start;
            echo 
    "<!-- Rendered in $time seconds -->\n";
        }
    }
    Вот footer.php
    PHP код:
    <div id="footer-bg">
        <div id="footer" class="lw">
        
            <p>&copy; <?php echo date'Y' ); ?> <?php bloginfo('name'); ?> &mdash; <?php __'All Rights Reserved.''montezuma' ); ?> Работает на <a href="http://designlove.ru/" title="Все для WordPress">WordPress</a></p>
            <!-- 
            <p><?php echo get_num_queries(); ?> queries in <?php timer_stop(1); ?>  seconds.</p>
            -->    
            
        </div>
        

    </div>
    Помогите, целый вечер парюсь и все не как не могу решить.
    • 0
  2. Новичок Аватар для Noxium
    • Регистрация: 07.11.2013
    • Сообщений: 10
    • Репутация: 1
    • Webmoney BL: ?
    Аналогичная беда, убираю ссылку сайт умирает.
    Пока закрыл ссылки noindex но все равно неприятно
    • 0
  3. Sapienti sat Аватар для brainix
    • Регистрация: 01.01.2013
    • Сообщений: 1,925
    • Записей в дневнике: 1
    • Репутация: 817
    • Webmoney BL: ?
    Foka7, кеш плагин стоит? Кеш же обновлять надо после обновления кода.
    • 1

    Спасибо сказали:

    Foka7(08.11.2013),
  4. Дипломник
    • Регистрация: 01.02.2013
    • Сообщений: 103
    • Репутация: 13
    • Webmoney BL: ?
    Нет, но поставил его, думал поможет.
    Все ровно все плачевно.

    P.S. Я не знаю как так, но скачал с официального сайта шаблон, а у меня все ровно стоит ссылка.
    Фантастика =)
    Последний раз редактировалось Foka7; 08.11.2013 в 03:49.
    • 0
  5. Sapienti sat Аватар для brainix
    • Регистрация: 01.01.2013
    • Сообщений: 1,925
    • Записей в дневнике: 1
    • Репутация: 817
    • Webmoney BL: ?
    Foka7, т.е. если вот это вписать в файл футера, то ссылка все равно есть?
    PHP код:
    <div id="footer-bg"> 
        <div id="footer" class="lw"> 
            <p>&copy; <?php echo date'Y' ); ?> <?php bloginfo('name'); ?>  
        </div> 
    </div>
    Сайт локалке или хостинге сейчас?
    • 1

    Спасибо сказали:

    Foka7(08.11.2013),
  6. Дипломник
    • Регистрация: 01.02.2013
    • Сообщений: 103
    • Репутация: 13
    • Webmoney BL: ?
    Да, все так же.

    Нажмите на изображение для увеличения.  Название:	21.jpg  Просмотров:	12  Размер:	91.5 Кб  ID:	12265

    Сайт на локалке.
    • 0
  7. Дипломник
    • Регистрация: 01.02.2013
    • Сообщений: 103
    • Репутация: 13
    • Webmoney BL: ?
    Решил проблему, но не совсем конечно как хотелось.

    Заново установил WP.
    Скачал с оф. сайта.
    Он правда на английском, но зато без левых ссылок.

    Может кто подскажет как тот допилить?
    • 0
  8. Sapienti sat Аватар для brainix
    • Регистрация: 01.01.2013
    • Сообщений: 1,925
    • Записей в дневнике: 1
    • Репутация: 817
    • Webmoney BL: ?
    Foka7, вполне возможно, что вы редактируете не тот файл. Попробуйте редактировать через админку вп, а не сами файлы, которые вы думаете, что это именно они. Сам редактировал через редактор админки и все было ок.
    • 1

    Спасибо сказали:

    Foka7(08.11.2013),
  9. Гуру Аватар для ohmygod
    • Регистрация: 30.04.2011
    • Сообщений: 1,064
    • Репутация: 268
    • Webmoney BL: ?
    Цитата Сообщение от Foka7 Посмотреть сообщение
    Да, все так же. Сайт на локалке.
    На скриншоте открыт файл admin\default-templates\sub-templates\footer.php
    Код нужно вписывать в footer.php, лежащий в корне темы.
    • 1

    Спасибо сказали:

    Foka7(08.11.2013),
  10. Дипломник
    • Регистрация: 01.02.2013
    • Сообщений: 103
    • Репутация: 13
    • Webmoney BL: ?
    C помощью brainix проблема была решена. Оказывается нужно было другой footer.php редактировать.
    Я редактировал тот что, был не в корне. А нужно было редактировать именно тот что в корне находился.
    Огромная благодарность тем к том помогал.
    • 0

Похожие темы

Темы Раздел Ответов Последний пост
Помогите убрать ссылку!
DLE 6 22.10.2012 18:28
Прошу помочь из паблик темы убрать сквозную ссылку
WordPress 8 09.06.2012 03:17
Помогите убрать невидимую ссылку из сайта
Вопросы от новичков 6 23.02.2012 10:48
Как убрать внешнюю ссылку из компонента комментариев.
Web программирование 9 18.08.2011 03:51
Как убрать внешнюю ссылку из компонента комментариев.
Вопросы от новичков 0 16.08.2011 20:25

У кого попросить инвайт?

Вы можете попросить инвайт у любого модератора:

Информеры