Forums

how to disable autolinks plugin in pages? (7 posts)

  1. swordfish
    Member
    Posted 6 years ago #

    is there a way to disable autolinks plugin in pages? or say particular pages?

    it is overwriting my tags page with its links :(

    any ideas?

  2. Link to the plugin? Not familiar with it.

  3. swordfish
    Member
    Posted 6 years ago #

    viper,

    here is the link:
    http://www.forceagainstsomething.com/index.php/auto-links-plugin-for-wordpress/

    I hope you can solve my problem.

    Thanks.

  4. swordfish
    Member
    Posted 6 years ago #

    guys,

    need some help here :(

  5. Learn to be patient. ;)

    Anyway, it looks like if you find this line in auto-links.php:

    function al_parse_post ($al_postText) {

    and add this code after it, it should work:

    if (is_page('a Page ID, stub or title here') || is_page('another page') || is_page('etc.')) return $al_postText;

    Let me know if it doesn't and I'll look into the plugin more.

  6. swordfish
    Member
    Posted 6 years ago #

    Viper, thanks for the responce. I checked it only today.
    It dosent seem to work. Here is my code:
    ===============
    function autolinks_parsepost ($al_postText) {
    //added by me
    if (is_page('a Page ID, stub or title here') || is_page('another page') || is_page('etc.')) return $al_postText;
    // Setup globals and initialize variables.
    global $al_keywordsAndLinks;
    global $al_showLinkGraphic;
    global $al_linkGraphicUrl;
    global $al_linkTargetWindow;
    $al_patterns = array();
    $al_replacements = array();
    $al_keyword = null;
    $al_links = null;

    // Get the keywords and links array and Auto Links options.
    get_autolinks_keywordsAndLinks();
    get_autolinks_options();
    ..........
    ===============

  7. forceagainstsomething
    Member
    Posted 6 years ago #

    Hey,
    If it's overwhelming your pages with links, then you might first want to remove some of the words from your keywords list. Don't add a keyword if you think you're only going to use it in one post and never again.

    Also make sure you're not using words that are too simple. "Jack" would be a bad keyword, but "Jack's Blog" would be better.

    To get the plugin to ignore a post altogether, try something like this:

    (Starting at around line 68 with version v0.93.1)
    function al_parse_post ($al_postText) {

    if (!strstr($al_postText, '<noautolinks></noautolinks>')) {

    // All the code here

    }

    Then, add <noautolinks></noautolinks> to any post that you want Auto Links to ignore. I haven't tested that, but seems like it should work.

    - Sean

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags