spam referal

Support Area Forums Moonrise spam referal

Viewing 4 posts - 1 through 4 (of 4 total)
URL to the page in question: http://
  • Author
    Posts
  • #26263
    sebastien garnier
    Participant

    hi Bill,
    Yesterday I ve done a modification in header.php in order to stop spam referal from russia (blackhatworth.com & …)
    I’ve done an upgrade with the new release of moonrise and my modifications have been erased.
    today I’ve written :

    <!DOCTYPE html>
    <!–[if IE 8 ]> <html class=”ie8″> <![endif]–>
    <!–[if IE 9 ]> <html class=”ie9″> <![endif]–>
    <!–[if (gt IE 9)|!(IE)]><!–> <html <?php language_attributes(); ?>> <!–<![endif]–>
    <head>

    <?php tha_head_top(); ?>

    <title><?php wp_title( ‘|’, true, ‘right’ ); ?></title>

    <meta charset=”<?php bloginfo( ‘charset’ ); ?>” />

    <!–Load WP Head–>

    <?php wp_head(); ?>

    <!– End WP Head –>

    <meta http-equiv=”X-UA-Compatible” content=”IE=edge,chrome=1″>

    <?php if(of_get_option(‘favicon’, $single = true) != “”){ ?>
    <link rel=”shortcut icon” href=”<?php echo of_get_option(‘favicon’); ?>” type=”image/x-icon” />
    <?php } ?>

    <?php if(of_get_option(‘apple’, $single = true) != “”){ ?>
    <link rel=”apple-touch-icon-precomposed” href=”<?php echo of_get_option(‘apple’); ?>” />
    <?php } ?>

    <meta name=”viewport” content=”width=device-width, initial-scale=1.0″>

    <?php tha_head_bottom(); ?>
    ******************************************************************************************
    <script type=’text/javascript’>
    var blocklink = [‘http://blackhatworth.com/&#8217;,’http://semalt.semalt.com/&#8217;,’http://hulfingtonpost.com/&#8217;,’http://forum.topic54762175.darodar.com/&#8217;,’http://buttons-for-website.com/&#8217;,’http://cenoval.ru/&#8217;,’http://bestwebsitesawards.com/’%5D;
    for (var b = blocklink.length; b–;) {
    if (document.referrer.match(blocklink[b]))
    window.location = “http://priceg.com/&#8221;;
    </script>
    ***********************************************************************************************

    </head>

    <body <?php body_class(); ?>>

    <div id=”header”>

    <div id=”header-content” class=”cf”>

    <?php if( of_get_option( ‘header_blog_title’ ) == ‘image’ ) { ?>

    <div id=”logo”><?php
    if (is_front_page()) {
    echo ‘<h1>'.get_bloginfo('name').'</h1>’;
    } else {
    echo ‘<p>'.get_bloginfo('name').'</p>’;
    }
    ?>
    </div>

    <?php } elseif ( of_get_option( ‘header_blog_title’ ) == ‘text’ ) { ?>

    <div id=”text-logo”><?php
    if (is_front_page()) {
    echo ‘<h1>‘.get_bloginfo( ‘name’ ).’</h1>’;
    } else {
    echo ‘<p>‘.get_bloginfo( ‘name’ ).’</p>’;
    }
    ?></div>

    <?php } ?>

    <?php wp_nav_menu( array(
    ‘theme_location’ => ‘primary’,
    ‘container’ => ‘nav’,
    ‘container_id’ => ‘navigation’,
    ‘container_class’ => ‘header-menu’,
    ‘menu_id’ => ‘site-navigation’,
    ‘fallback_cb’ => false
    ) ); ?>

    </div><!– #header-content –>

    </div><!– #header –>

    how to do to keep the modification (the add of the java script) in case of new release of moonrise?

    best regards

    #26273
    Bill Robbins
    Moderator

    Hello Sebastian,

    Good question. You could create a child theme (https://support.organizedthemes.com/child-themes/) and place the modifications there. Once the child theme is created you would copy the header.php file from the original theme and paste it into the child theme. Then you can make your changes there.

    There’s at least one plugin that allows you to add javascript without editing the theme. It’s called Custom css-js-php (https://wordpress.org/plugins/custom-css-js-php/). To be fair, I’ve never tried it, but that may work as well.

    Take care,
    Bill

    #26320
    sebastien garnier
    Participant

    I ll have a look on Child themes. Thank you very much Bill!
    Best regards

    #26324
    Bill Robbins
    Moderator

    Glad to help out Sebastien. Let me know if you need anything else.

    Bill

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘spam referal’ is closed to new replies.