I have been facing this peculiar problem. I am fairly new at WordPress development and I have been trying to set up a maid listing site and few other services too. For this I had created three custom post types for them. However when I put custom slug in the navigation menu, the button seems to get clicked but isn't getting toggled. However, it works on the home page and any other page I add. Here is a link to the site : http://dougleschan.com/kteamhelpers/

Also check for mobile version too.

Here is the template for maids,

<?php /* Template Name: Maids and Nannies */ ?>

<?php get_header(); ?>
<h2 class="page-title"><?php post_type_archive_title(); ?></h2>
    $args = array(
        'post_type' => 'maids',
        'orderby' => 'meta_value',
        'meta_key' => 'code',
        'posts_per_page' => 15,
        'paged' => $paged
    add_filter( 'the_title', 'max_title_length');
<?php if (have_posts()) : ?>
<div class="profiles-wrapper">
<ul class="profiles-overview">
<?php while (have_posts()) : the_post(); ?>
    <li class="item">
    <a href="<?php the_permalink(); ?>" title="">
    <?php if ( has_post_thumbnail() ) { ?>
        <?php the_post_thumbnail('profile-small', array('class' => 'aligncenter')); ?>
    <?php } else { ?>
        <img class="profiles-img" src="<?php bloginfo('stylesheet_directory'); ?>/images/default-profile-small.png" alt="" />
    <?php } ?>
    <div class="description">
        <h4 class="post-name"><?php echo $post->post_title; ?></h4>
        <?php if (get_field('nationality')) { ?>
            <li><?php the_field('nationality'); ?></li>
        <?php } ?>
        <?php if (get_field('age')) { ?>
            <li><span>Age</span>: <?php the_field('age'); ?></li>
        <?php } ?>
        <?php if (get_field('experience')) { ?>
            <li><span>Experience</span>: <?php the_field('experience'); ?>
            <?php if(get_post_meta($post->ID, 'experience', true) == '1') { ?>
            <?php } else { ?>
            <?php } ?>
        <?php } ?>
        <?php if (get_field('code')) { ?>
            <li><span>Code</span>: <?php the_field('code'); ?></li>
        <?php } ?>
        <div class="viewprofile"><a href="<?php the_permalink(); ?>" title="">View profile <i class="fa fa-caret-right"></i></a></div>
<?php endwhile; ?>
<div class="pagination"><?php wp_pagenavi('query_posts' == $args); ?></div>
<?php else: ?>
    <p>No <span style="text-transform: lowercase;"><?php post_type_archive_title(); ?></span> available.</p>
<?php endif; ?>
<?php wp_reset_query(); ?>
<?php get_footer(); ?>

1 Answer 1


I was just navigating through that code and was able to solve it myself. If you look at the 5th line from the start I have called the wp_pagenavi() function which requires a plugin named WP-pagenavi. After installing and setting it up, I got the desired results. Thanks anyways :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.