Home » Ask (Forum) » How to create a dropdown menu for Genre & years

Question

Sir,
I need help in creating a dropdown menu for my website. I’m using bikinwebsite 07 [ movie/video website]. I want to add 2 options like genre & years to menu. when clicked on genre on menu I want it to show a dropdown & show all the available genres. Similarly I want to Show Years in menu. But there is no Years option in the theme. so I also want to know how to create a new element called years and add diffrent fields under it and then show it own menu.

I want to make a menu similar to this website’s menu : ” unduhfilmrama.biz ” with the dropdown part. so please help.

Apr 1, 2017 (4 months ago) - Posted by 2 Comments

2 Answers

  1. Danis Al Rafi says:

    Up min

    Unregister Member
  2. Support says:

    Hello, for create genre in dropdown menu:
    1. Open your dashboard admin.
    2. Go to Appearance >> Menus.
    3. In left side, select “Custom Links” and enter the URL and Link Text. You can get genre URL from Posts >> Genre Movies.
    4. Screenshot: https://s14.postimg.org/h81j2cgup/ss_genre.png

    ***

    For add years option in new post:
    1. Open functions.php (inside your theme folder) file.
    2. Find this line:

    add_filter( 'the_content', 'prefix_insert_post_ads' );

    3. After the above line, copy paste the below code:

    function bw_bikinfilm_years() {
    	$labels = array(
    		'name'                       => _x( 'Years', 'Taxonomy General Name', 'bw_translate' ),
    		'singular_name'              => _x( 'Year', 'Taxonomy Singular Name', 'bw_translate' ),
    	);
    	$args = array(
    		'labels'                     => $labels,
    		'hierarchical'               => false,
    		'public'                     => true,
    		'show_ui'                    => true,
    		'show_admin_column'          => false,
    		'show_in_nav_menus'          => false,
    		'show_tagcloud'              => false,
    	);
    	register_taxonomy( 'year', array( 'post' ), $args );
    
    }
    add_action( 'init', 'bw_bikinfilm_years', 0 );

    4. Update file.
    5. Now you have a Year form in “New Post“.
    Screenshot: https://s13.postimg.org/vucaw11if/ss_years_form.png

    ***

    For display the Year in single post:
    1. Open single.php (inside your theme folder).
    2. Find this line:

    <div class="bw_crew"><?php echo get_the_term_list( $post->ID,'genre', '<strong>Genre</strong> ', ', ', '' ); ?></div>

    3. Copy paste the below code after the above code:

    <div class="bw_crew"><?php echo get_the_term_list( $post->ID,'year', '<strong>Movie Year</strong> ', ', ', '' ); ?></div>

    4. Update file.

    Good luck!

    Team Support

Your Answer

Your email address will not be published. Required fields are marked *