Thanks for the links…but, what do they mean. As I said, I’m new to this.
The info in those links is really confusing.
It’s all the info you need to create your dynamic sidebars. You could also try downloading a few free themes and looking at how the sidebars have been created.
I did download a free theme. I installed and configured the Intrepidity theme because it fits my business colors best.
I read through those articles and recall seeing this quote a time or two: “If you can’t answer these questions, maybe someone will be nice enough to help you on the forums”
Well, that is why I am here asking for help. I read a lot about these before posting my question. It seems these articles assume you already know how to build a theme/widgets from scratch. I don’t.
Using my existing theme (Intrepidity), I have no idea where to start with doing this.
Update, after some searching, I found at least the parts of the code mentioned in the article I posted in the first post.
But, I know that just throwing in someone else’s code will more than likely screw something up.
Here is the basics of what I want:
1) User clicks on page
2) Sidebar shows links to all sub-pages for that page
3) All sub-pages show those same links, like a mini nav menu?
Please help me
i am pretty new to wordpress and i’m basically a themer who knows just enough about php to not want to touch it more than i have to. i disabled the dynamic sidebar in my latest site, and it was a lot easier to set up:
http://mumford-photo.com/wordpress/
I strip out lots of php code that i don’t understand and am left with a bare-bones loop that i can edit. it is amazing that this method works! wordpress seems very robust.
my advice is: unless you know php code pretty well, i’d make your sidebar as simple as possible.
a book that i’ve found very helpful is Smashing WordPress.
Alright, I have begun to try this myself. Since its not a live site, I can afford to mess it up and start over if needed. Below is what I’ve done so far going by all the examples and tutorials. But it does not work.
Going by the example in the link I put in the first post, I added this code to my functions.php
register_sidebar(array('name'=>'RememberMe', 'before_widget' => '<li class="widget" id="%1$s">', 'after_widget' => '</li>', 'before_title' => '<h2><a href="#" rel="nofollow" class="sidebartitle">', 'after_title' => '</a></h2>'));
register_sidebar(array('name'=>'WatchYourIP', 'before_widget' => '<li class="widget" id="%1$s">', 'after_widget' => '</li>', 'before_title' => '<h2><a href="#" rel="nofollow" class="sidebartitle">', 'after_title' => '</a></h2>'));
Then, at the bottom of the Functions.php file, I added this:
function getTopParentPostName($myid) {
$mypage = get_page($myid);
if ($mypage->post_parent == 0){
return $mypage->post_name;
}
else{
return getTopParentPostName($mypage->post_parent);
}
}
function is_tree( $p_name ) { // $p_name = The page we're looking for pages underneath
global $post; // We load this as we're outside of the post
$top_post_name = getTopParentPostName($post);
if ( $p_name == $top_post_name ) return true;
else return false;
}
I added this to my Sidebar.php
if ( is_tree('rememberme') ) {
if (!function_exists('dynamic_sidebar') || !dynamic_sidebar( 'RememberMe') ) { $generic_sidebar = true; }
}
elseif ( is_tree('watchyourip')) {
if (!function_exists('dynamic_sidebar') || !dynamic_sidebar( 'WatchYourIP') ) { $generic_sidebar = true; }
}
Am I doing something wrong by asking for additional help with this?
I’ve commented twice now to see it is gone.
Can anyone look at my code above and see if I am doing it wrong? I’ve tried following the examples provided, but they seem to all assume I can already create my own theme or widgets. I’m a newcomer to the world of WordPress and need help.