Archived topic
Custom Post Type with custom layout
30 replies · Started by tenchystryder on December 19, 2019
Let's try this:
remove_action( 'wpclubmanager_before_main_content', 'wpclubmanager_output_content_wrapper', 10);
remove_action( 'wpclubmanager_after_main_content', 'wpclubmanager_output_content_wrapper_end', 10);
add_action('wpclubmanager_before_main_content', function() {
?>
<div id="primary" <?php generate_do_element_classes( 'content' );?>>
<main id="main" <?php generate_do_element_classes( 'main' ); ?>>
<?php do_action( 'generate_before_main_content' ); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php generate_do_microdata( 'article' ); ?>>
<div class="inside-article">
<?php do_action( 'generate_before_content' ); ?>
<div class="entry-content" itemprop="text">
<?php
} );
add_action('wpclubmanager_after_main_content', function() {
?>
</div><!-- .entry-content -->
<?php do_action( 'generate_after_content' ); ?>
</div><!-- .inside-article -->
</article><!-- #post-## -->
<?php do_action( 'generate_after_main_content' ); ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php
} );
add_action( 'after_setup_theme', function() {
add_theme_support( 'wpclubmanager' );
} );
Within the wp_head Tom and for entire site ?
Using one of these methods: https://docs.generatepress.com/article/adding-php/
Warning: array_key_exists() expects parameter 2 to be array, null given in /homepages/27/d767341814/htdocs/********/wp-content/plugins/wp-club-manager/templates/single-player/stats-table.php on line 30
**** hidden website bit. Used snippets
Ahhhhh .... sorted that. Info wasn't added in
Tom
You are a friggin genius mate.
Single profile page is spot on. Let me just get some more info in over next day or two so I can check for errors but looking good so far.
At the Bottom of that page Tom are 2 widgets (Archive and Search).
That it seems is my right side bar Ha Ha
Ok now I seem to be getting somewhere after about 5 hours of messing around.
Apart from linking up on the menu and generally getting some data and colour into the site, my one and only question is can I move the footer widgets above the main content ?
I know there are some threads on here about it but most are quite old now and I can't find one with a solution. I have used the move top bar hack on my other site, can this be done with the footer widgets ?
(or add a widget area above content) ?
Hmm, you could try this:
add_action( 'wp', function() {
remove_action( 'generate_footer', 'generate_construct_footer_widgets', 5 );
add_action( 'generate_after_header', 'generate_construct_footer_widgets' );
} );
Let me know :)
It worked but repeated the widgets so they were still in footer.
Strangely, the plugin author did an update last night and one of the fixes was errors when certain content fields were empty, hence I was having to add data to get rid of them. So that is one issue resolved.
Also, one of the theme conflicts is the sidebars appearing to the left under content. I have now resolved that.
Just updated the code above - it should remove the footer widgets: https://generatepress.com/forums/topic/custom-post-type-with-custom-layout/page/2/#post-1111807
That's great Tom.
Just need some space between the 3 widgets now and some centre alignment.
Tried some custom css but not liking it :-(
What about adding this?:
.footer-widgets .widget {
padding: 40px;
text-align: center;
}
Thanks Tom. That's perfect
So with the plugin update this week and your amazing help, this has gone from a rough looking site to pretty much where I wanted it.
I can't thank you enough. :-)
Super support as always
Post removed: Now sorted :-)