I have a page template that links though to another php file to define what is displayed. The code for the page is -

<?php /*
Template Name: Portfolio
*/ ?>
<?php get_header(); ?>  

<?php if(!is_front_page()): ?>
  <div id="pageHead" class="withBorder">
    <h1><?php the_title(); ?></h1>
    <?php $page_description = get_post_meta($post->ID, "_ttrust_page_description_value", true); ?>
    <?php if ($page_description) : ?>
      <p><?php echo $page_description; ?></p>
    <?php endif; ?>             
<?php endif; ?>         

<div id="content" class="fullProjects clearfix">

  <?php the_content(); ?>               

  <?php include( TEMPLATEPATH . '/includes/projects.php'); ?>


<?php get_footer(); ?>

I would like to add code that changes which linked file it accesses based on the browser size, is this possible?

The line that links is - <?php include( TEMPLATEPATH . '/includes/projects.php'); ?>



  • The answer you got to this question is essentially the answer to this question as well.
    – s_ha_dum
    Sep 6, 2013 at 16:19
  • I have tried using that code on the template page but I must be implementing it wrong as I haven't been able to make it work. Sep 6, 2013 at 16:43


Your Answer

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

Browse other questions tagged or ask your own question.