Skip to content

Instantly share code, notes, and snippets.

@pnething
Created August 31, 2012 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pnething/3555712 to your computer and use it in GitHub Desktop.
Save pnething/3555712 to your computer and use it in GitHub Desktop.
page.php
<?php get_header(); ?>
<?php $has_sidebar = ss_framework_check_page_layout(); ?>
<?php if( tribe_is_month() && !is_tax() ) { // The Main Calendar Page
echo 'Events Calendar';
} elseif( tribe_is_month() && is_tax() ) { // Calendar Category Pages
echo 'Events Calendar';
} elseif( tribe_is_event() && !tribe_is_day() && !is_single() ) { // The Main Events List
echo 'Events List';
} else {
$page_title = ss_framework_get_custom_field(‘ss_page_title’);
ss_framework_get_custom_field(‘ss_page_title’) : get_the_title();
}; ?>
<section id="content" class="clearfix <?php echo ss_framework_check_sidebar_position(); ?>">
<div class="container">
<?php if ( !is_front_page() && ss_framework_get_custom_field('ss_disable_page_header') != '1' ): ?>
<header class="page-header">
<h1 class="page-title"><?php echo $page_title ?></h1>
<?php if( ss_framework_get_custom_field('ss_page_description') ): ?>
<hr />
<h2 class="page-description"><?php echo ss_framework_get_custom_field('ss_page_description'); ?></h2>
<?php endif; ?>
<?php if( ss_framework_get_custom_field('ss_page_subdescription') ): ?>
<hr />
<h2 class="page-subdescription"><?php echo ss_framework_get_custom_field('ss_page_subdescription'); ?></h2>
<?php endif; ?>
<?php do_action('ss_framework_portfolio_filter'); ?>
</header><!-- end .page-header -->
<?php endif; ?>
<?php if( $has_sidebar ): ?>
<section id="main">
<?php endif; ?>
<?php if (have_posts()) while ( have_posts() ): the_post(); ?>
<?php the_content(); ?>
<?php wp_link_pages( array( 'before' => '' . __( 'Pages:', 'ss_framework' ), 'after' => '' ) ); ?>
<p><?php edit_post_link( __( 'Edit', 'ss_framework' ), '', '' ); ?></p>
<?php endwhile; ?>
<?php if( $has_sidebar ): ?>
</section><!-- end #main -->
<?php get_sidebar(); ?>
<?php endif; ?>
</div><!-- end .container -->
</section><!-- end #content -->
<?php get_footer(); ?>
<?php get_header(); ?>
<?php $has_sidebar = ss_framework_check_page_layout(); ?>
<?php $page_title = ss_framework_get_custom_field('ss_page_title') ? ss_framework_get_custom_field('ss_page_title') : get_the_title(); ?>
<section id="content" class="clearfix <?php echo ss_framework_check_sidebar_position(); ?>">
<div class="container">
<?php if ( !is_front_page() && ss_framework_get_custom_field('ss_disable_page_header') != '1' ): ?>
<header class="page-header">
<h1 class="page-title"><?php echo $page_title ?></h1>
<?php if( ss_framework_get_custom_field('ss_page_description') ): ?>
<hr />
<h2 class="page-description"><?php echo ss_framework_get_custom_field('ss_page_description'); ?></h2>
<?php endif; ?>
<?php if( ss_framework_get_custom_field('ss_page_subdescription') ): ?>
<hr />
<h2 class="page-subdescription"><?php echo ss_framework_get_custom_field('ss_page_subdescription'); ?></h2>
<?php endif; ?>
<?php do_action('ss_framework_portfolio_filter'); ?>
</header><!-- end .page-header -->
<?php endif; ?>
<?php if( $has_sidebar ): ?>
<section id="main">
<?php endif; ?>
<?php if (have_posts()) while ( have_posts() ): the_post(); ?>
<?php the_content(); ?>
<?php wp_link_pages( array( 'before' => '' . __( 'Pages:', 'ss_framework' ), 'after' => '' ) ); ?>
<p><?php edit_post_link( __( 'Edit', 'ss_framework' ), '', '' ); ?></p>
<?php endwhile; ?>
<?php if( $has_sidebar ): ?>
</section><!-- end #main -->
<?php get_sidebar(); ?>
<?php endif; ?>
</div><!-- end .container -->
</section><!-- end #content -->
<?php get_footer(); ?>
@jo-snips
Copy link

Hi Philipp, try this:
<?php if( tribe_is_month() && !is_tax() ) { // The Main Calendar Page

echo 'Events Calendar';

} elseif( tribe_is_month() && is_tax() ) { // Calendar Category Pages

echo 'Events Calendar';

} elseif( tribe_is_event() && !tribe_is_day() && !is_single() ) { // The Main Events List

echo 'Events List';

} else {

$page_title = ss_framework_get_custom_field('ss_page_title') ? ss_framework_get_custom_field('ss_page_title') : get_the_title();

}; ?>

@jo-snips
Copy link

I see what the problem is, you need to assign the custom titles to the $page_title variable since that's what is actually used for the display. This should work.

@jo-snips
Copy link

jo-snips commented Sep 3, 2012

Try this for categories:

@jo-snips
Copy link

jo-snips commented Sep 3, 2012

Correction:

@jo-snips
Copy link

jo-snips commented Sep 4, 2012

Ooops, try this:

@pnething
Copy link
Author

pnething commented Sep 6, 2012

Awesome. This works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment