WordPress.org

Ready to get started?Download WordPress

Forums

How can I amend a theme's PHP file to make it include text on a 'portfolio page? (3 posts)

  1. samwizzle
    Member
    Posted 1 year ago #

    Hi. I'm using the excellent pinboard theme. I have a page using the 'porfolio' template - but I need it to also show some static text before it shows the dynamic content. Having googled around it seems I need to edit the template's PHP file to make it include page content (rather than ignore it as it does at the moment). I don't have enough experience in PHP to work this out so I would be very grateful if someone could help

    Here is the template's code:

    <?php
    /*
    Template Name: Portfolio
    */
    ?><?php get_header(); ?>
    	<?php global $pinboard_page_template; ?>
    	<?php $pinboard_page_template = 'template-portfolio.php'; ?>
    	<?php if( pinboard_get_option( 'location' ) ) : ?>
    		<?php pinboard_current_location(); ?>
    	<?php endif; ?>
    	<div id="container">
    		<section id="content" class="column onecol">
    			<?php pinboard_category_filter( pinboard_get_option( 'portfolio_cat' ) ); ?>
    			<?php $args = array( 'cat' => pinboard_get_option( 'portfolio_cat' ), 'posts_per_page' => get_option( 'posts_per_page' ), 'paged' => max( 1, get_query_var( 'paged' ) ) ); ?>
    			<?php global $wp_query, $wp_the_query; ?>
    			<?php $wp_query = new WP_Query( $args ); ?>
    			<?php if( $wp_query->have_posts() ) : ?>
    				<div class="entries">
    					<?php while( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
    						<?php get_template_part( 'content', get_post_format() ); ?>
    					<?php endwhile; ?>
    				</div><!-- .entries -->
    				<?php pinboard_posts_nav(); ?>
    			<?php else : ?>
    				<?php pinboard_404(); ?>
    			<?php endif; ?>
    			<?php wp_reset_postdata(); ?>
    			<?php $wp_query = $wp_the_query; ?>
    		</section><!-- #content -->
    		<div class="clear"></div>
    	</div><!-- #container -->
    <?php get_footer(); ?>
  2. noahjonah
    Member
    Posted 1 year ago #

    The same text on everypage or different per page?

  3. samwizzle
    Member
    Posted 1 year ago #

    I'd like the text to be whatever I put into the page on the WP dashboard.

    At the moment, I have some 'intro text' on a page with a portfolio template, but the template ignores everything on the page and goes straight to the dynamic part. So no intro.

Topic Closed

This topic has been closed to new replies.

About this Topic