• Hi

    I have a problem related to customizing my sidebar. I use the WP 45 degrees theme found here:

    https://www.bestwpthemes.com/45-degrees/

    I made some graphic customization of the template and I’m satisfied with that. My problem is related to some customizations regarding the sidebar. You see I’ve made some newsletters with a special design. I want to get rid of the menu system on the left sidebar only when the newsletter appear because I want some text/html in there instead (which is going to replace the menu). To navigate on the newsletter pages I want to use only horizontal menu on the top. I want only
    those pages that are not newsletters to show the left menu as normal.

    Take a look at my pages here: https://laafrikaleve.no. I want all the default vertical links in the left sidebar to dissapear on Newsletter pages because I need space for some text/html instead. The navigation for those sites will be the horizontal one on the top.

    I have also made two screenshots.

    1) Default Page: https://i41.tinypic.com/r0xhxd.jpg

    2) Newsletter page: https://i42.tinypic.com/34q5unt.jpg

    So what is the best solution to handle this?

    1) To create a custom template with different sidebar? I’m not an php expert but understand the principles so a explanation with code would be appreciated. As mentioned above I use 45 degrees theme. When creating pages inside there I don’t see the options to select a second template. How to register that so I can see a template list to choose from?

    2) … or is it better to use a widget that can handle this? And if so what is the best one and how is the best description to use it?

    Andy

Viewing 3 replies - 1 through 3 (of 3 total)
  • I’d recommend the custom page template approach. You won’t see the Page template dropdown box in your Admin area until you have at least 1 custom template in your theme.

    Thread Starter andy-hawkins

    (@andy-hawkins)

    Thanks Esmi

    Ok, maybe the best solution is to have a custom template, but what is the description if I only want to have a different sidebar? If you take a look at the screenshots you see that I need to replace my default sidebar with a customized one showing up my own design. Can anyone help me and show me a short description of code to start with?

    I understand that I must base my new template with a new one. I have these files: page.php (template) and sidebar.php. So now I must create a new template with a different sidebar, i.e. sidebar2.php.

    Here is my page.php code:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    So my questions is: How to implement the code on the new page template to use sidebar2? Maybe it is so simple that the only thing I have to do is to change <?php get_sidebar(); ?> to <?php get_sidebar2(); ?>

    …next, in my sidebar2 I only want to show searchform at the top and text/html after that so it can meet my requirements. What is the code to make that happen? I think it will be a lot of research today, but I’ll appreciate if someone can help me with some hints and quickstart code ??

    Andy

    Call your custom sidebar something like sidebar-custom.php and then use <?php get_sidebar('custom');?> in your custom page template.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Customized Sidebar Template or Widget?’ is closed to new replies.