Programmers: can you do this in Wordpress?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • clickhappy
    Confirmed User
    • Mar 2004
    • 4027

    #1

    Programmers: can you do this in Wordpress?

    Right now the sidebars in my Wordpress blog are all static.
    So if someone is on the anal page, they'll see the exact same side bars as if theyre on the cumshot page, the tranny page, the ebony page, etc.

    Is there any way I can make it dynamic? So when someone is on the ebony page it shows some ebony banners in my sidebars? And when someone is on the anal page it shows anal banners on the sidebars?

    In the url it does say www.mysite.com/anal, www.mysite.com/ebony etc.
    So maybe theres a way to pull the category name from the url and have it so that whatever category is showing in the url, will show the approriate banner in the url.

    Anyone know how to do this?
  • k0nr4d
    Confirmed User
    • Aug 2006
    • 9231

    #2
    Im not sure how wordpress passes in its categories but you could put something along the lines of this in your template
    Code:
    <?
    $category = $_GET[category]; //not sure about this part, might need to explode(); the url and use the last value in the array, as i said i dont know how this is put together in wordpress exactly. 
    if($category == 'anal') { echo "html code for anal banner"; } 
    elseif($category == 'ebony') { echo "html code for ebony"; } 
    else { echo "no matches, generic banner html"; }
    ?>
    Mechanical Bunny Media
    Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development

    Comment

    • clickhappy
      Confirmed User
      • Mar 2004
      • 4027

      #3
      Originally posted by k0nr4d
      Im not sure how wordpress passes in its categories but you could put something along the lines of this in your template
      Code:
      <?
      $category = $_GET[category]; //not sure about this part, might need to explode(); the url and use the last value in the array, as i said i dont know how this is put together in wordpress exactly. 
      if($category == 'anal') { echo "html code for anal banner"; } 
      elseif($category == 'ebony') { echo "html code for ebony"; } 
      else { echo "no matches, generic banner html"; }
      ?>
      Aweosme, im going to try that

      Thank you!

      Comment

      • Jace
        FBOP Class Of 2013
        • Jan 2004
        • 35562

        #4
        yup, what he said above, just tell wordpress to check the category before it pulls the sidebar, then it loads a certain sidebar for that category

        you can tell it multiple sidebar.php file, and then just duplicate the sidebar.php in your ftp for each sidebar you need

        Comment

        • sarettah
          see you later, I'm gone
          • Oct 2002
          • 14298

          #5
          Programmers: can you do this in Wordpress?
          Yes, I can.













          Next question please
          All cookies cleared!

          Comment

          • clickhappy
            Confirmed User
            • Mar 2004
            • 4027

            #6
            I cant get that to work correctly.

            Comment

            • fris
              Too lazy to set a custom title
              • Aug 2002
              • 55679

              #7
              this is some serious business
              Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

              Comment

              • BigBen
                Confirmed User
                • Nov 2004
                • 2299

                #8
                http://codex.wordpress.org/Conditional_Tags

                Comment

                • Ace_luffy
                  www.creationcrew.com
                  • Feb 2005
                  • 12164

                  #9
                  serious ....


                  ++ Adult and Mainstream Websites Designs | 10 banners for only $50 | html5 Banners ++
                  email : [email protected] Telegram : https://t.me/creationcrew WhatsApp : +63 956 420 4819 | HTML5/Responsive Site - Div/CSS - ElevatedX - NATs - Wordpress

                  Comment

                  • Nicky
                    Too lazy to set a custom title
                    • Mar 2003
                    • 30071

                    #10
                    I want wordpress to load niche specific link trades in the side bar for each category and full list of link trades on main page, can it do that?

                    gfynicky @ gmail.com

                    Comment

                    • beta-tester
                      Rock 'n Roll Baby!
                      • Sep 2004
                      • 22562

                      #11
                      you can use is_category() function and the combine it with conditional tag....for example if(is_category('teen')) { whatever; }

                      Sig for sale. Affordable prices. Contact me and get a great deal ;)

                      My contact:
                      ICQ: 944-320-46
                      e-mail: manca {AT} HotFreeSex4All.com

                      Comment

                      • clickhappy
                        Confirmed User
                        • Mar 2004
                        • 4027

                        #12
                        I just can't code.
                        How much would it cost to hire a programmer to do this for me?

                        Comment

                        • scouser
                          marketer.
                          • Aug 2006
                          • 2280

                          #13
                          ok, lets say you've got 3 categories,
                          babe
                          lesbian
                          black

                          this is untested, but should work ...

                          PHP Code:
                          <?php
                          if (is_category('babe')) {
                          ?>
                          <a href="#"><img src="yourbabeadvert.jpg" alt="" /></a>
                          <?php
                          }
                          
                          if (is_category('lesbian')) {
                          ?>
                          <a href="#lesbian"><img src="yourlesbianadvert.jpg" alt="" /></a>
                          <?php
                          }
                          
                          
                          if (is_category('black')) {
                          ?>
                          <a href="#black"><img src="yourblackadvert.jpg" alt="" /></a>
                          <?php
                          }
                          
                          ?>
                          As said, http://codex.wordpress.org/Conditional_Tags is where you want to look. Hit me up over icq if you need help. Note- that will display the ad when viewing just the category page itself. To display it when viewing a post in category x, use in_category()
                          Last edited by scouser; 04-19-2007, 09:23 AM.

                          Comment

                          • clickhappy
                            Confirmed User
                            • Mar 2004
                            • 4027

                            #14
                            Originally posted by deadmoon
                            ok, lets say you've got 3 categories,
                            babe
                            lesbian
                            black

                            this is untested, but should work ...

                            PHP Code:
                            <?php
                            if (is_category('babe')) {
                            ?>
                            <a href="#"><img src="yourbabeadvert.jpg" alt="" /></a>
                            <?php
                            }
                            
                            if (is_category('lesbian')) {
                            ?>
                            <a href="#lesbian"><img src="yourlesbianadvert.jpg" alt="" /></a>
                            <?php
                            }
                            
                            
                            if (is_category('black')) {
                            ?>
                            <a href="#black"><img src="yourblackadvert.jpg" alt="" /></a>
                            <?php
                            }
                            
                            ?>
                            As said, http://codex.wordpress.org/Conditional_Tags is where you want to look. Hit me up over icq if you need help. Note- that will display the ad when viewing just the category page itself. To display it when viewing a post in category x, use in_category()
                            thank you, All done out. Nice. ill try this

                            Comment

                            • clickhappy
                              Confirmed User
                              • Mar 2004
                              • 4027

                              #15
                              Originally posted by deadmoon
                              ok, lets say you've got 3 categories,
                              babe
                              lesbian
                              black

                              this is untested, but should work ...

                              PHP Code:
                              <?php
                              if (is_category('babe')) {
                              ?>
                              <a href="#"><img src="yourbabeadvert.jpg" alt="" /></a>
                              <?php
                              }
                              
                              if (is_category('lesbian')) {
                              ?>
                              <a href="#lesbian"><img src="yourlesbianadvert.jpg" alt="" /></a>
                              <?php
                              }
                              
                              
                              if (is_category('black')) {
                              ?>
                              <a href="#black"><img src="yourblackadvert.jpg" alt="" /></a>
                              <?php
                              }
                              
                              ?>
                              As said, http://codex.wordpress.org/Conditional_Tags is where you want to look. Hit me up over icq if you need help. Note- that will display the ad when viewing just the category page itself. To display it when viewing a post in category x, use in_category()

                              It works!!
                              Thank you!

                              btw, I have a LOT of categories, would this slow down the page to have like 50 categories listed inthis code? is there a way to make it so I dont slow down the page processing?

                              Comment

                              Working...