1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

New position on wordpress

Discussion in 'Content Management' started by fallensebastian, Dec 3, 2012.

  1. #1
    Hello all., actually i'm new to digging into wordpress themes and wondering if i can create a new position on wordpress theme to place a widget. is this a kind of hacking? is there any plugin available to do this visually or do i need to know php? thanks guys
     
    fallensebastian, Dec 3, 2012 IP
  2. bowodesign

    bowodesign Member

    Messages:
    55
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #2
    just place this code in your theme right in the place you want to add the widget
    
    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('customwidget') ) : ?>
                <?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?>
                <?php endif; ?>
    
    Code (markup):
    and add this to your functions.php

    
    <?php
    if (function_exists("register_sidebar")) {
            register_sidebar(Array("name" => "customwidget"));
    }
    ?>
    
    Code (markup):
    and do css styling to decorate it
     
    bowodesign, Dec 5, 2012 IP
  3. natattack06

    natattack06 Greenhorn

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    6
    #3
    Nice one Bowowdesign!
     
    natattack06, Dec 5, 2012 IP
  4. fallensebastian

    fallensebastian Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4


    thanks for the reply :) i'm gonna try this now!!!!
     
    fallensebastian, Dec 5, 2012 IP
  5. webzesty

    webzesty Greenhorn

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #5
    Will also try this.
     
    webzesty, Dec 5, 2012 IP
  6. fallensebastian

    fallensebastian Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    not successful.. let me confirm it whether what i did was right

    adding this to functions.phh
    adding this on the footer.php
    after doing this i got some error... sorry i'm not into scripts stuff, so please help., thanks guys
     
    fallensebastian, Dec 5, 2012 IP
  7. bowodesign

    bowodesign Member

    Messages:
    55
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #7
    lol sorry buddy but you got wrong, the 1st code put on the place where you want the widget show, and the 2nd code to the functions.php, you did wrong.. :D
     
    bowodesign, Dec 6, 2012 IP
  8. fallensebastian

    fallensebastian Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    so i have to add both the codes in functions.php right?? i'll try now..
     
    fallensebastian, Dec 6, 2012 IP
  9. bowodesign

    bowodesign Member

    Messages:
    55
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #9
    no,

    for example you want to show widget on footer, add the 1st code in the footer

    and the 2nd code in the functions.php
     
    bowodesign, Dec 6, 2012 IP
  10. fallensebastian

    fallensebastian Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    ok, so the first code goes to footer.php right? sorry if i'm outside the track. as i said earlier i'm new to php stuffs and cracking wordpress :0 thanks for being so patience :)
     
    fallensebastian, Dec 6, 2012 IP
  11. bowodesign

    bowodesign Member

    Messages:
    55
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #11
    yap thats right 1st on footer.php 2nd on functions.php
     
    bowodesign, Dec 6, 2012 IP
  12. fallensebastian

    fallensebastian Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    exactly followed the steps and got this error :)

    This one on main functions.php file
    Parse error: syntax error, unexpected '{' in /home/success/public_html/testdir/2/wp-content/themes/aaanr_morning_v1.0.5/functions.php on line 41

    and i was suggested to edit functions file inside the user folder and got this
    Parse error: syntax error, unexpected '{' in /home/success/public_html/testdir/2/wp-content/themes/aaanr_morning_v1.0.5/functions/user/functions.php on line 1
     
    fallensebastian, Dec 10, 2012 IP
  13. fallensebastian

    fallensebastian Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    sorry guys i sorted out.. the problem was

    <?phpif (function_exists("register_sidebar")) {
    register_sidebar(Array("name" => "customwidget"));
    }
    ?>

    I just copied and pasted this code., later only i checked this error <?phpif i can see custom widget now. great help bowodesign :)
     
    fallensebastian, Dec 10, 2012 IP
  14. bowodesign

    bowodesign Member

    Messages:
    55
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #14
    great to hear that buddy :)
     
    bowodesign, Dec 11, 2012 IP