How to remove front page php safely
-
I’m using a theme that only shows a widget on the front page only. I want to make it so that it shows on every page and post… how do I safely remove or change?
<?php if(is_front_page()) : ?>
-
Hello there!
Where is that code located? in your functions.php file?Hi! No, it’s in the index.php of the theme!
<div class="beforecontent-container"> <?php if(is_front_page()) : ?> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Before Content Widget") ) : ?><?php endif; ?> <?php endif; ?>Got it! Can you tell me what theme do you use?
Thanks!
please post a larger section of the code, or the full code of the template
Apologies – I’m using the ‘Driftwood’ theme by Nudge Media Design.
This is the full index.php
<?php get_header(); ?> <div class="container"> <?php if(get_theme_mod( 'nmd_featured_slider' ) == true) : ?> <?php get_template_part('inc/featured/featured'); ?> <?php endif; ?> <div class="beforecontent-container"> <?php if(is_front_page()) : ?> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Before Content Widget") ) : ?><?php endif; ?> <?php endif; ?> </div> <div id="content"> <div id="main" <?php if(get_theme_mod('nmd_sidebar_homepage') == true) : ?>class="fullwidth"<?php endif; ?>> <?php if(get_theme_mod('nmd_home_layout') == 'grid' || get_theme_mod('nmd_home_layout') == 'full_grid') : ?><ul class="nmd-grid"><?php endif; ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <?php if(get_theme_mod('nmd_home_layout') == 'grid') : ?> <?php get_template_part('content', 'grid'); ?> <?php elseif(get_theme_mod('nmd_home_layout') == 'list') : ?> <?php get_template_part('content', 'list'); ?> <?php elseif(get_theme_mod('nmd_home_layout') == 'full_list') : ?> <?php if( $wp_query->current_post == 0 && !is_paged() ) : ?> <?php get_template_part('content'); ?> <div class="bannerad-container"> <?php if(is_front_page()) : ?> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Banner Ad Widget") ) : ?><?php endif; ?> <?php endif; ?> </div> <?php else : ?> <?php get_template_part('content', 'list'); ?> <?php endif; ?> <?php elseif(get_theme_mod('nmd_home_layout') == 'full_grid') : ?> <?php if( $wp_query->current_post == 0 && !is_paged() ) : ?> <?php get_template_part('content'); ?> <div class="bannerad-widget-container"> <div class="bannerad-widget"> <?php if(is_front_page()) : ?> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Banner Ad Widget") ) : ?><?php endif; ?> <?php endif; ?> </div> </div> <?php else : ?> <?php get_template_part('content', 'grid'); ?> <?php endif; ?> <?php else : ?> <?php get_template_part('content'); ?> <?php endif; ?> <?php endwhile; ?> <?php if(get_theme_mod('nmd_home_layout') == 'grid' || get_theme_mod('nmd_home_layout') == 'full_grid') : ?></ul><?php endif; ?> <?php nudgemedia_pagination(); ?> <?php endif; ?> </div> <?php if(get_theme_mod('nmd_sidebar_homepage')) : else : ?><?php get_sidebar(); ?><?php endif; ?> <?php get_footer(); ?>edit this section:
<div class="beforecontent-container"> <?php if(is_front_page()) : ?> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Before Content Widget") ) : ?><?php endif; ?> <?php endif; ?> </div>to look like:
<div class="beforecontent-container"> <?php dynamic_sidebar("Before Content Widget"); ?> </div>please direct any further theme specific questions to the developer of the theme;
http://codex.wordpress.org/Forum_Welcome#Commercial_ProductsThank you very much :3
The topic ‘How to remove front page php safely’ is closed to new replies.