- This topic has 7 replies, 2 voices, and was last updated 4 years ago by
Tom.
-
AuthorPosts
-
March 1, 2019 at 8:02 am #825726
David
Hello,
I’ve set up a custom post type called locations.
I’ve then copied the single page and called it single-locations.php.
How do I remove the <article></article> content box – its just a big white space that sits above the image slider at the moment…
http://185.20.51.60/~hiremarqueeco/locations/hampshire/
The page consists of this…
<?php
/**
* The Template for displaying all single posts.
*
* @package GeneratePress
*/if ( ! defined( ‘ABSPATH’ ) ) {
exit; // Exit if accessed directly.
}get_header(); ?>
>
<main id=”main” <?php generate_do_element_classes( ‘main’ ); ?>>
<?php
/**
* generate_before_main_content hook.
*
* @since 0.1
*/
do_action( ‘generate_before_main_content’ );while ( have_posts() ) : the_post();
get_template_part( ‘content’, ‘single’ );
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || ‘0’ != get_comments_number() ) :
/**
* generate_before_comments_container hook.
*
* @since 2.1
*/
do_action( ‘generate_before_comments_container’ );
?><?php comments_template(); ?><?php
endif;endwhile;
/**
* generate_after_main_content hook.
*
* @since 0.1
*/
do_action( ‘generate_after_main_content’ );
?>
</main><!– #main –><!– #primary –>
<?php
/**
* generate_after_primary_content_area hook.
*
* @since 2.0
*/
do_action( ‘generate_after_primary_content_area’ );generate_construct_sidebars();
get_footer();
GeneratePress 2.2.2March 1, 2019 at 2:42 pm #826016Tom
Lead DeveloperLead DeveloperHi there,
Try removing this line:
get_template_part( 'content', 'single' );
Let me know π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMarch 4, 2019 at 12:43 am #828026David
Great, thanks Tom π
March 4, 2019 at 9:10 am #828556Tom
Lead DeveloperLead DeveloperYou’re welcome π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMarch 4, 2019 at 9:29 am #828566David
On a seperate note, can you please help with this…
Basically Im trying to show content on the frontend depending on a option selected in ACF, like this…
https://thenorthernfoundry.com/acf-conditional-radio-buttons-options-page/I’ve set up a radio button with the options yes and no and the field name terms_box , so if they select yes in the back end it should then show yes the content, if they select no it should show the no content. I’ve got this but not working…
<?php if(get_field(‘terms_box’, ‘option’) == ‘yes’) : ?>
<p>YES TEXT</p><?php elseif(get_field(‘terms_box’, ‘option’) == ‘no’) : ?>
<p>NO TEXT</p><?php else : ?>
<!β Do nothing β>
<?php endif; ?>March 4, 2019 at 4:32 pm #828877Tom
Lead DeveloperLead DeveloperThat code looks right, at least according to that documentation. Have you checked with ACF?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMarch 5, 2019 at 1:06 am #829141David
Yea, didn’t get anything back – I think because it’s in a repeater field that is why it isn’t working.
March 5, 2019 at 9:32 am #829710Tom
Lead DeveloperLead DeveloperIn that case you would likely need to implement a
foreach()
to output each item inside the repeater field.Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.