Removing Navigation Bar From Single Pages

Hello,

I am building some different pages in my website for use in a webapp. I would like to strip down these pages to only the necessary content to aid in the experience of using my website from a mobile device.

Here is an example of one of my pages that I am using for browsers: http://rigmonkeyapp.com/sample-page/

And here is an example of the “sister” page that I have started to strip down: http://rigmonkeyapp.com/property-search-page-for-app/

I have started by removing the footer and parts of the header by inserting this code into the PHP files: [php]<?php if( !is_page('1232') ) :?>[/php] and specifying the page id so that I don’t remove those items from the entire website.

I would like to remove the navigation bar completely but I have no clue how to do that.

I also would like to remove the “call us 814-768-7838511 Spruce Street (Suite 5) Clearfield, PA 16830” text from the top of the page.

If anyone has any idea how I can do this, I would GREATLY appreciate it!! If you need my any PHP files that you can’t access from my website, just let me know and I will post them here.

Thanks!!

Well, the phone number and address should be easy to find in your source code.
You can look at all the pages and find it and remove it. As far as panels go, it really depends
on how the pages are set up. What language are you writing the phone app in? Or do you
mean you are creating a web page that would just be smaller for viewing on a phone?
So, for example, if your current page is written in HTML/PHP/Javascript, you most likely will
have DIV’s that hold the entire panel. So, deleting that DIV will remove the panel. But, you
should be able to see this layout in your editor. If you are using DreamWeaver, you can select
the panel and split the code/design into two parts and you will see all the code highlighted that
holds that panel.
I have a guess that does not make sense to you. I find that most people programming for
phones start the project from scratch so that the display can be laid out better. This makes for
better use of display area and can be tested easier. Also, a phone or mobile APP is not a web page.
Give us a little more to go on and perhaps we can help.

I am taking the regular webpage and just removing some of the items such as the navigation bar, footer, etc. so that it looks better on a phone.

Here is the php code for my header file:

[php]

> <?php

wp_title( ‘|’, true, ‘right’ );

// Add the blog name.
bloginfo( ‘name’ );

// Add the blog description for the home/front page.
$site_description = get_bloginfo( ‘description’, ‘display’ );
if ( $site_description && ( is_home() || is_front_page() ) ) {
echo " | $site_description";
}

// Add a page number if necessary:
if ( $paged >= 2 || $page >= 2 ) {
echo ’ | ’ . sprintf( __( ‘Page %s’, ‘denali’ ), max( $paged, $page ) );
}

?>

<?php if(file_exists( STYLESHEETPATH . '/favicon.ico') ) { ?> <?php } ?> <?php wp_head(); ?> >
<?php get_template_part('header','contact-us'); ?>

<?php get_template_part('header','login'); ?>

<?php get_template_part('header','property-search'); ?>
  <?php get_template_part('header','dropdown-links'); ?>
<?php if(current_theme_supports('header-card') && $ds['hide_header_card'] != 'true' ): ?>
    <div class="header_business_card">
    <?php echo (!empty($ds['phone']) ? "<span class='phone'>" . apply_filters("denali_call_us_text", ($ds['phone_number_prefix'] ? $ds['phone_number_prefix'] : __('call us', 'wpp'))) . " <span class='number'>{$ds['phone']}</span></span>": "");?>
    <?php echo ($ds['hide_address_from_card'] != 'true' && !empty($ds['address']) ? " <span class='address'>{$ds['address']}</span>": "");?>
<a target="_blank" href="http://www.clearlyahead.com"><img border="0" src="http://rigmonkeyapp.com/wp-content/uploads/2011/07/ccedcpower.jpg" width="258" height="66"></a> 

    </div>
  <?php endif; ?>


  <?php if ( class_exists( 'qTranslateWidget' ) && $ds['show_qtranslate_widget'] ): ?>
    <?php the_widget('qTranslateWidget', array('hide-title'=>true, 'type'=>'image')); ?>
  <?php endif; ?>

  <?php  if($ds['hide_logo'] != 'true' ): ?>
  <?php if (!empty($ds['logo'])){ ?>
    <span class="custom_logo"><a href="<?php echo home_url(); ?>" title="<?php bloginfo('name'); ?>"><img src="<?php echo $ds['logo']?>" alt="<?php bloginfo('name'); ?>" /></a></span>
  <?php } else { ?>
    <span class="logo"><a href="<?php echo home_url(); ?>" title="<?php bloginfo('name'); ?>"><span class="denali_text_logo"><?php echo $ds['logo_text']; ?></span></a></span>
  <?php } ?>
  <?php endif; ?>

</div>
<?php wp_nav_menu(apply_filters('denali_header_menu', array(
  'theme_location'=> 'header-menu',
  'menu_class'    => 'main-nav',
  'link_before'   => '<span class="menu"><span class="link_text">',
  'link_after'    => '</span></span>',
  'depth'         => 2  )));
?>

<?php wp_nav_menu(apply_filters('denali_sub_header_menu', array(
  'theme_location'=> 'header-sub-menu',
  'menu_class'    => 'header-sub-menu',
  'link_before'   => '<span class="menu"><span class="link_text">',
  'link_after'    => '</span></span>',
  'fallback_cb'    => false,
  'depth'         => 2  )));

[/php]

Here is my footer PHP file. I included code to conditionally remove the footer if it is one of the pages specified in the “IF” coding. I would like to do the same thing with the navigation bar. Remove it only on certain pages.
[php]<?php if( !is_page('1234') ) :?>

<?php if( !is_page('1232') ) :?> <?php if( !is_page('1209') ) :?> <?php if( !is_page('1267') ) :?> <?php if($ds['disable']['footer_description'] != 'true') { $site_description = get_bloginfo('description'); } if($ds['disable']['denali_footer_follow'] != 'true') { $denali_footer_follow = denali_footer_follow(); } if($ds['disable_footer_bottom_left_block_widget_area'] != 'true' && is_active_sidebar( "latest_listings" )) { $show_latest_listings = true; } if(current_theme_supports('footer_explore_block') && $ds['footer_explore_block_hide'] != 'true') { $show_expore_block = true; } if($ds['footer_menu_hide'] != 'true') { if($footer_menu = wp_nav_menu(array( 'theme_location' => 'footer-menu', 'menu_class' => 'footer-nav', 'before' => '', 'after' => '', 'echo' => false, 'fallback_cb' => 'denali_list_pages' ))) echo ($footer_menu ? "
{$footer_menu}
" : ''); } ?>
<?php if ( $show_latest_listings ) { ?>
<div class="foot_last_list equal_heights">
<?php dynamic_sidebar( 'latest_listings' ); ?>
</div>
<?php } ?> <?php if($show_expore_block) { ?>
<div class="foot_explore equal_heights <?php echo (!$show_latest_listings ? 'big' : ''); ?>">
<?php if($ds['footer_explore_title_hide'] != 'true') { ?>
  <h5 class="explore_block_title"><?php _e("Explore", 'wpp'); ?></h5>
<?php } ?>
<?php if ($ds['options_explore'] == 'custom_html') {  echo do_shortcode(nl2br($ds['explore']['custom_html_content'])); } ?>

<?php if ($ds['options_explore'] == 'pages') {
   ?> <ul> <?php
   wp_list_pages('title_li=&number=8&offset=0&depth=1');
   ?></ul><ul> <?php
   wp_list_pages('title_li=&number=8&offset=8&depth=1');
   ?> </ul> <?php
   $pages = get_posts();
} ?>

<?php  if ($ds['options_explore'] == 'cats'){
    $cats = explode("<br />",wp_list_categories('title_li=&echo=0&depth=1&style=none'));
    $cat_n = count($cats) - 1;
    for ($i=0;$i< $cat_n;$i++){
        if ($i<$cat_n/2){
            $cat_left = $cat_left.'<li>'.$cats[$i].'</li>';
        }elseif ($i>=$cat_n/2){
            $cat_right = $cat_right.'<li>'.$cats[$i].'</li>';
        }
    }
    ?>
  <ul class="left"><?php echo $cat_left;?></ul>
  <ul class="right"><?php echo $cat_right;?></ul>
<?php } ?>
</div><?php /* .foot_explore */ ?>
    
<?php }; ?>

  <div class="foot_far_right equal_heights">
    <ul class="footer_right_elements">
      <?php echo (!empty($ds['phone']) ? "<li class='footer_phone'><span>{$ds[phone]}</span></li>": "");?>
      <?php if(!empty($site_description)) { ?><li class="site_description"><?php echo $site_description; ?></li><?php } ?>
      <?php if(!empty($denali_footer_follow)) { ?><li class="bottom_right_icons denali_footer_follow"><?php echo $denali_footer_follow; ?></li><?php } ?>
      <?php if($ds['show_equal_housing_icon'] == 'true') { ?><li class="equal_housing_wrapper"><span class="equal_housing_icon">&nbsp;</span></li><?php } ?>
      <li class="bot_right"><span class="copy"> Copyright &copy; <?php the_time('Y '); bloginfo(' name'); ?></span></li>
    </ul>
</div>
<?php

if($ds[‘bottom_of_page_menu_hide’] != ‘true’) {
if($bottom_of_page_menu = wp_nav_menu(array(
‘theme_location’ => ‘bottom_of_page_menu’,
‘menu_class’ => ‘bottom_of_page_menu’,
‘echo’ => false,
‘fallback_cb’ => ‘denali_list_pages’
))) echo ($bottom_of_page_menu ? ‘

’ . $bottom_of_page_menu . ‘
’ : ‘’);
}
?> <?php //** .wrapper */ ?> <?php wp_footer(); ?> <?php endif;?> <?php endif;?> <?php endif;?> <?php endif;?> [/php]

Yikes, I think you have opened a can of worms as we say here in the states!

First, you have code in the pages you posted for IE. So, all of that could be dropped.
You also have Javascript which last time I looked did not work on all phones.
Next, a large number of phones can be portrait or landscape especially the iPhone, so there
would be problems with layout issues. Portrait or landscape display can be checked in Javascript
which is now accessible on the iPhone, but, not on all phones. Onclick and Onblur in Javascript
do not work on most phones. Many other commands just do not exist right now.

One good note is that PHP is server-side, so it will always work. And at least that makes me smile!

So, you should start by looking at this long table of compatiblities for phones and check how many items
you are using in your site that do not work. Or, just create a new site and only use the basics. (my choice!)
Or, right an actual phone app… Check out this site first:
http://www.quirksmode.org/m/table.html

Sponsor our Newsletter | Privacy Policy | Terms of Service