atmmultimedia Posted May 28, 2010 Share Posted May 28, 2010 Hello everyone, Firstly, I want to say this is the best forum I've seen so far. I have a basic knowledge of PHP. I can get by with includes. I am modifying a WordPress website for a client. The client wants a video player displayed in the website, which is fine. There is an include there for the video player. WordPress is made up of several PHP files. In the header file: I've placed this code: <?php if ( is_page('7') ) { ?> <?php include('videoplayer.php'); ?> <?php } else { ?> <?php } ?> Which means on page 7 of the wordpress site displayed the content of the video player. In the video player.php file there is a title and breadcrumb. In the image attached you can see I have a duplicate title and brumbcrumb, the title and breadcrumb below the video player needs to be removed. I am curious how to apply an if statment to this. Here is the code I'll need to change to apply the if statement. Any help will be greatly appreictated. <?php // the title if (strpos(get_the_title($post->ID), '//')) { $thisTitle = '<strong>' . str_replace('//', '</strong> // ', get_the_title($post->ID)); }else { $thisTitle = '<strong>'. get_the_title($post->ID) .'</strong>'; } ?> <!-- Title / Page Headline --> <div class="full-page"> <h1 class="headline"><?php echo $thisTitle; ?></h1> </div> <div class="hr"></div> <!-- Breadcrumbs --> <div class="full-page"> <p class="breadcrumbs"> <?php show_breadcrumbs(); ?> </p> </div> <!-- End of Content --> <div class="clear"></div> What I am trying to do is to place if statement that if page is = 7 appears I'd like no post title and no breadcrumbs please. Many many thanks [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
pornophobic Posted May 28, 2010 Share Posted May 28, 2010 This could be done a few ways. You could do it with CSS, which is what I would do because it has the least modifications to the code. Pardon my pseudo-code. if ( is_page('7') ) { echo '<style type="text/css">.breadcrumbs{display:none !important;} .headline{display:none !important;}'; } Quote Link to comment Share on other sites More sharing options...
atmmultimedia Posted May 28, 2010 Author Share Posted May 28, 2010 Hi I've tried that, And it appears not to do anything unless. I've placed the code in the wrong place. <?php if ( is_page('7') ) { echo '<style type="text/css">.breadcrumbs{display:none !important;} .headline{display:none !important;}'; } // the title if (strpos(get_the_title($post->ID), '//')) { $thisTitle = '<strong>' . str_replace('//', '</strong> // ', get_the_title($post->ID)); }else { $thisTitle = '<strong>'. get_the_title($post->ID) .'</strong>'; } ?> <!-- Title / Page Headline --> <div class="full-page"> <h1 class="headline"><?php echo $thisTitle; ?></h1> </div> <div class="hr"></div> <!-- Breadcrumbs --> <div class="full-page"> <p class="breadcrumbs"> <?php show_breadcrumbs(); ?> </p> </div> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.