php - How to make a "page-option" in WordPress

admin2025-06-02  1

I had made a WordPress website with my own theme. I have a navigation menu on the top of my website with dropdowns.

Then you click on a page in this menu, I want you to navigate to a page, where there is a specific widget with a navigation...

But, on another dropdown page I want another widget.

So, my question is: "How can I make an "option" to choose the right widget to a specific page?".

I hope someone can help! - thanks.

I had made a WordPress website with my own theme. I have a navigation menu on the top of my website with dropdowns.

Then you click on a page in this menu, I want you to navigate to a page, where there is a specific widget with a navigation...

But, on another dropdown page I want another widget.

So, my question is: "How can I make an "option" to choose the right widget to a specific page?".

I hope someone can help! - thanks.

Share Improve this question edited Feb 28, 2019 at 16:10 Marc 7415 silver badges15 bronze badges asked Feb 28, 2019 at 11:44 Oscar S.Oscar S. 191 gold badge1 silver badge3 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

You can define a specific page template for the specific widget then you can select template page as on your navigation menu.

<?php
/*
Template Name: page one
*/
get_header();
?>

    <div class="main-wrap ">
        <?php
            if (is_active_sidebar( "widgetName" )) {
                dynamic_sidebar( "widgetName" );
            }
        ?>
    </div> 

<?php get_footer(); ?> 
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748854452a314275.html

最新回复(0)