-
Notifications
You must be signed in to change notification settings - Fork 17
Home
srikat edited this page Aug 16, 2015
·
6 revisions
Welcome to the one-pager-genesis wiki!
How to make Portfolio featured images link to CPT single page rather than having it open in a lightbox?
In functions.php replace
$image = '<div class="portfolio-image"><a rel="prettyPhoto[pp_gal]" href="' . genesis_get_image( array('format' => 'url') ) . '">' . genesis_get_image( array('format' => 'html', 'size' => 'portfolio') ) . '</a></div> ';
with
$image = '<div class="portfolio-image"><a rel="bookmark" href="' . apply_filters( 'the_permalink', get_permalink() ) . '">' . genesis_get_image( array('format' => 'html', 'size' => 'portfolio') ) . '</a></div> ';
I want to use inner pages as well. But the nav menu links do not work. Can I use a different menu on inner pages?
Yes. Follow http://sridharkatakam.com/replace-header-right-widget-area-conditionally-genesis/.
In front-page.php, change
<?php echo do_shortcode('[display-posts post_type="portfolio" image_size="portfolio" posts_per_page="6" wrapper="div"]'); ?>
to
<?php echo do_shortcode('[display-posts post_type="portfolio" image_size="portfolio" posts_per_page="6" wrapper="div" include_excerpt="true"]'); ?>
Source: https://github.com/billerickson/display-posts-shortcode/wiki
Create a file named home.js in /js having:
jQuery(function( $ ){
$('#welcome') .css({'height': (($(window).height()))+'px'});
$(window).resize(function(){
$('#welcome') .css({'height': (($(window).height()))+'px'});
});
});
Then add this in front-page.php:
//* Enqueue Scripts
add_action( 'wp_enqueue_scripts', 'enqueue_custom_scripts' );
function enqueue_custom_scripts() {
// for setting the height of Welcome section equal to that of viewport
wp_enqueue_script( 'home', get_bloginfo( 'stylesheet_directory' ) . '/js/home.js', array( 'jquery' ), '1.0.0', true );
}
Screenshots:
- In front-page.php, replace
<!-- Portfolio section -->
<section id="portfolio" class="parallax">
<article class="wrap">
<h2>Our Portfolio</h2>
<?php echo do_shortcode('[display-posts post_type="portfolio" image_size="portfolio" posts_per_page="6" wrapper="div"]'); ?>
</article>
</section>
with
<!-- Blog section -->
<section id="blog" class="parallax">
<article class="wrap">
<h2>From Our Blog</h2>
<?php echo do_shortcode( '[display-posts post_type="post" image_size="portfolio" posts_per_page="6" wrapper="div"]' ); ?>
</article>
<a href="/blog" class="more-link">More blog posts »</a>
</section>
- In style.css,
a) replace all occurrences of #portfolio
with #blog
.
b) add
#blog .wrap {
padding-bottom: 0;
}
#blog a.image {
display: block;
}
a.more-link {
text-align: right;
}
- In functions.php delete or comment out
add_filter( 'display_posts_shortcode_output', 'one_pager_display_posts_shortcode_output', 10, 9 );