• is there any way to redirect to respective posts rather than to the category when category menu item is clicked

Viewing 1 replies (of 1 total)
  • Hello @joeldejo

    The category dropdown included in the header section is a theme feature i.e. it will list the category you have included in the theme.

    But if you still want the section to list the recent posts, you have to go through the child theme approach.
    For this yo need to create and activate child theme.
    Child theme reference:

    https://codex.www.ads-software.com/Child_Themes

    Or you can simply create the child theme using the plugin. Refer to below link for one of the plugin for creating child theme.

    https://www.ads-software.com/plugins/wp-child-theme-generator/

    After successfully creating and activating the child theme, in your child theme’s functions.php paste below code.

    if( ! function_exists( 'photo_perfect_add_category_navigation' ) ) :
    
      
      function photo_perfect_add_category_navigation(){
    
    	$show_category_dropdown = photo_perfect_get_option( 'show_category_dropdown' );
        if ( true !== $show_category_dropdown ) {
          return;
        }
    	$header_category_text   = photo_perfect_get_option( 'header_category_text' );
        ?>
        <div id="category-menu" class="clear-fix header-navigation">
          <div class="container">
            <button class="nav-list-btn"><i class="fa fa-list"></i><span><?php echo       esc_html( $header_category_text ); ?></span></button>
            <div class="category-list-wrapper">
              <ul><?php
              $recent_posts = wp_get_recent_posts();
              
             foreach( $recent_posts as $recent ){ 
                  echo '<li><a href="' . get_permalink($recent["ID"]) . '">'   .$recent["post_title"].'</a> </li> ';
              
              }
        wp_reset_query();?>
              </ul>
            </div><!-- .category-list-wrapper -->
          </div><!-- .container -->
        </div><!-- #category-menu -->
        <?php
      }
    endif;

    Hope this helps.

    Also if you want more dedicated and swift support on the theme, please visit the theme’s official support forum where the theme’s official support team are stand by to answer each and every one of your questions.
    https://themepalace.com/forum/photo-perfect/

    Best regards.

Viewing 1 replies (of 1 total)
  • The topic ‘Category redirect’ is closed to new replies.