1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Wordpress Coding Question

Discussion in 'Black Hat SEO' started by killzone, Apr 20, 2009.

  1. killzone

    killzone Regular Member

    Joined:
    Jan 3, 2009
    Messages:
    251
    Likes Received:
    92
    Home Page:
    Hey guys I have a question, I want to add some code to my Wordpress blog, I am pretty bad with code so I am not sure how to go about this. Specifically I want to add the anonymizeit code to the page. What is the best way to do this? Add it to the footer? Header? body? How do I do that? just open it with a text editor, copy paste the code and re-up?

    Thanks in advance.
     
  2. trapmuzik

    trapmuzik Junior Member

    Joined:
    Mar 20, 2009
    Messages:
    192
    Likes Received:
    22
    what exactly is the code.. i can probably help if i knew what the code is
     
  3. entreprenuer

    entreprenuer Regular Member

    Joined:
    Apr 19, 2009
    Messages:
    200
    Likes Received:
    73
    Location:
    Orlando Fl
    Yeah I am the same as killzone. I have no idea how to effectively add codes to my blog. That is my current bump right now.
     
  4. gimme4free

    gimme4free Executive VIP Jr. VIP Premium Member

    Joined:
    Oct 22, 2008
    Messages:
    1,879
    Likes Received:
    1,932
    Open up header or footer.php in Dreamweaver is probably easiest.
     
    • Thanks Thanks x 1
  5. chrismccoy

    chrismccoy Newbie

    Joined:
    Jan 24, 2009
    Messages:
    20
    Likes Received:
    8
    what did you want to do? add the anonimize to all links you post on your blog automatically?
     
  6. Wizzoid

    Wizzoid Registered Member

    Joined:
    Dec 16, 2008
    Messages:
    94
    Likes Received:
    22
    That's the best method IMO.

     
  7. seomedia

    seomedia Registered Member

    Joined:
    Mar 18, 2009
    Messages:
    89
    Likes Received:
    33
    Occupation:
    seo
    Location:
    London, UK
    is there a plugin for this function to just allow you to add it via that?

    If not I'd recommend you learn the basics of code, it'll be really helpful in the long run trust me on this!

    I read an article called "hands on HTML" back when I was 15, and it was so helpful, you'll understand where to place code off the back of understanding this.

    I can't find it online at the moment but if/when I do I'll post the link, it was originally a free supplement with a PC Magazine, not a book, although a while back I saw it on PDF.
     
  8. Wizzoid

    Wizzoid Registered Member

    Joined:
    Dec 16, 2008
    Messages:
    94
    Likes Received:
    22
  9. killzone

    killzone Regular Member

    Joined:
    Jan 3, 2009
    Messages:
    251
    Likes Received:
    92
    Home Page:
    And then just paste the code? After that should I just upload the new edited file with like an FTP client?
     
  10. Sippy79

    Sippy79 Junior Member

    Joined:
    Feb 13, 2009
    Messages:
    104
    Likes Received:
    26
    Yes you currently download the file, edit it with proper HTML and reupload/overwrite the old file and you're set. I use mostly TotalCommander with built in FTP client and Notepad++ as my prefered editor so I can edit the files directly (timesaver) :)
     
  11. Worfik

    Worfik Registered Member

    Joined:
    Feb 22, 2007
    Messages:
    53
    Likes Received:
    9
    If your theme files are writable then you can edit them directly from wp-admin. Go to Design > Theme editor. It's quite useful for quick fixes.
     
  12. denight

    denight Registered Member

    Joined:
    Apr 7, 2009
    Messages:
    58
    Likes Received:
    26
    Here you go, simple regex does the trick...

    PHP:
    <?php
    /*
    Plugin Name: Anonymizeit
    Plugin URI: xxxx
    Description: xxxx
    Author: xxxx
    Version: 1.0
    Author URI: xxxx
    */


    // integrate with wordpress
    add_filter('the_content','run_anony');


    // main function
    function run_anony($string) {

    preg_match_all("/<a.*? href=\"(.*?)\".*?>(.*?)<\/a>/i"$string);
    $string str_replace("href=\"http","href=\"http://anonymizeit.com/?http",$string);

    return 
    $string;
    }
    ?>
    Put that code into a file named anon.php, then go to your plugins directory in wordpress, create a directory called anon, then put the anon.php file inside the anon directory.

    Then go to wordpress and activate the Anonymizeit plugin.

    All links in all posts (past and future) will now have the anonymize it code before them.

    Hope this is what you are looking for.

    dN
     
    • Thanks Thanks x 1