If post has gallery and post-thumbnail hide gallery

I'm making a custom theme from scratch for a customer and he wants it so on the front page, it hides the gallery if there's a post-thumbnail and on a sub-page, reversed. So here's my question:

I want to make it so it, on a specific page, checks if the post(s) has a post-thumbnail AND gallery and if it does, hide the gallery and only output the post-thumbnail. How would I do that? Here's my current post setup:

<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>     <h2><?php the_title(); ?></h2>         <p class="post-image"><?php the_post_thumbnail( array(400,400)); ?></p>         <p class="post-gallery">     <?php the_content(); ?> </div> 

I'm new to asking questions about coding on forums so sorry if I'm not being specific enough.

Replay

Category: theme development Time: 2016-07-30 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 2.440 (s). 13 q(s)