go41

Re: Restricting Sidebar Ad Views :: Reply by master

von Joern am 14. Feb. 2011 | Keine Kommentare

to get a ‚widgetized‘ div id="sidebar-ads" you have to edit sidebar.php and also functions.php in your theme folder
modify sidebar.php in div id="sidebar-ads" close to the top to look like this:

Code:

<div id="sidebar-ads">
   <?php /* Widget Sidebar Top Extra */ if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar Top Extra') ) : ?>

   <?php endif; ?>
</div>

(you might have div id="sidebar-pads" !!)
open up functions.php, here you find:

Code:

register_sidebar(array('name' => 'Sidebar Top','before_widget' => '','after_widget' => '','before_title' => '<h3>','after_title' => '</h3>'));
register_sidebar(array('name' => 'Sidebar Left','before_widget' => '','after_widget' => '','before_title' => '<h3>','after_title' => '</h3>'));
register_sidebar(array('name' => 'Sidebar Right','before_widget' => '','after_widget' => '','before_title' => '<h3>','after_title' => '</h3>'));


add just above the first line shown here one more line for your new widget ‚Sidebar Top Extra‘:
Code:

register_sidebar(array('name' => 'Sidebar Top Extra','before_widget' => '','after_widget' => '','before_title' => '<h3>','after_title' => '</h3>'));

now you should find in your dashboard a new widget
BACKUP originals before modifying!! I didn’t test…
____________________
you find me on Google+, Twitter and Facebook

(von: master)

Hier noch 3 weitere Ergebnisse dieses Threads:

Restricting Sidebar Ad Views

14. Feb. 2011 (von: raf_79)

I use a FF plugin (Dynamic Widgets) to control which sidebar widgets show up on the pages of my site. The sidebar ad although viewed in the sidebar is not in a widget so I can't control the pages it…

Re: Restricting Sidebar Ad Views :: Reply by raf_79

14. Feb. 2011 (von: raf_79)

Thank you much. This worked quite well except for the following...The contents of all the widgets were knocked out of order and I had to enter what I wanted in the new widget in the last footer widget in the…

Re: Restricting Sidebar Ad Views :: Reply by master

14. Feb. 2011 (von: master)

thank you for the hint, did not think about that.that is helpful!That's why I do not just number the part in sidebar but give all widgets the correct name likeCode:...|| !dynamic_sidebar('Sidebar Top')......|| !dynamic_sidebar('Sidebar Left')......|| !... Weiterlesen →

Autor:

Du findest mich auch auf Twitter und Facebook!

Schreibe einen Kommentar

Pflichtfelder sind mit * markiert.


Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.

weitere forum Beiträge: