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

Need help with Wordpress - Need a script to run based on the category of the post

Discussion in 'Hire a Freelancer' started by waikikicane, Apr 26, 2014.

  1. waikikicane

    waikikicane Registered Member

    Joined:
    Jul 5, 2011
    Messages:
    81
    Likes Received:
    42
    Hello everyone.

    As the title states, I need help coming up with a way to load a script on a Wordpress installation based on what category the post was created under.

    Category 1 runs Script 1
    Category 2 runs Script 2
    etc....

    I don't know how much this will run me, but if you can help give me your price and I can pay you via Paypal.

    Thanks in advance.
     
  2. spmcnerd

    spmcnerd Regular Member

    Joined:
    Dec 20, 2010
    Messages:
    309
    Likes Received:
    106
    Hello,I don't get it. Why not check off the category next to post?
     
  3. waikikicane

    waikikicane Registered Member

    Joined:
    Jul 5, 2011
    Messages:
    81
    Likes Received:
    42
    Can you explain further spmcnerd?
     
  4. nightcoders

    nightcoders Newbie

    Joined:
    Feb 24, 2014
    Messages:
    33
    Likes Received:
    0
    Hello,

    I am interested in your work please add me on skype for further details : michle_clark27

    thanks
     
  5. Game On

    Game On Regular Member

    Joined:
    Aug 31, 2013
    Messages:
    355
    Likes Received:
    32
    I can do this, add me on Skype.
     
  6. Gogol

    Gogol Elite Member

    Joined:
    Sep 10, 2010
    Messages:
    3,062
    Likes Received:
    2,872
    Gender:
    Male
    in your functions.php:

    Code:
    
    add_action('template_redirect', 'callback');
    
    function callback() {
        if (!is_category())
            return;
        your_script();
    }
    
    function your_script(){
        //write your script here
    }
    
    
    
     
    • Thanks Thanks x 2