John McCarthy
Forum Replies Created
-
Forum: Plugins
In reply to: WooCommerce – Body classIn reply to my own question…
Although I understand a fair amount about WordPress development, knowledge gets lots in the brain.
Basically to style the page using the body_class or <body class=””> you simply call the page name in css. For example: I wanted to style the home page which I have in my template files as Front-page.php. To style this page and make it full width using Store front, I simply needed to call
.home { .content-area { @include span(full); } }In the layout.scss file of my child theme. Glad have that cleared up, something I won’t be forgetting again 🙂
Forum: Plugins
In reply to: [WooCommerce] Remove "Related Products" from bottom of product pagesHey, the 20 stands for the order in which the function is fired. Check this link
<a href="http://www.kathyisawesome.com/412/thematic-hooks-and-functions/">php Basics</a>Kathy does a good job of explaining things.Thanks Matthew,
It’s actually the use and output of the fields that I struggle with. The way your class was made makes it very easy and intuitive to actually create any metabox or group of metabox that I require.
Sorry my question wasn’t that clear.
I’m using a function to call the meta boxes in my template files. Like so;
// Featurette Meta Box Tag function src_get_featurettes( $page_id ){ $featurettes = get_post_meta( $page_id, 'featurette', false ); if ( $featurettes ) { $featurette_list = "\n<div class='featurette-list'>\n"; foreach ( $featurettes as $featurette ) { $featurette_image = false; $featurette_head = false; $featurette_sub = false; $featurette_list .= "\t<div class='row featurette-wrap'>"; if ( $featurette['a_feat_img'] ) { $featurette_image .= '<aside class="small-12 medium-3 large-3 columns">'; $featurette_image .= wp_get_attachment_image( $featurette['a_feat_img'], 'thumbnail', false ); $featurette_image .= '</aside>'; } if ( $featurette['a_feat_head'] ) { $featurette_head .= '<article class="columns small-12 small-8 medium-8 right">'; $featurette_head .= '<h2>' . $featurette['a_feat_head'] . '</h2>'; } if ( $featurette['a_feat_sub'] ) { $featurette_sub .= wpautop ($featurette['a_feat_sub'] ); $featurette_sub .= "</article>"; } $featurette_list .= $featurette_image; $featurette_list .= $featurette_head; $featurette_list .= $featurette_sub; $featurette_list .= "</div>\n"; } $featurette_list .= "</div>\n"; return $featurette_list; } else { return false; } } function src_the_featurettes( $page_id ) { if ( src_get_featurettes( $page_id ) ) { echo src_get_featurettes( $page_id ); } else { return false; } }I’ve never used checkboxes or radio buttons before and I’m having trouble integrating it into the above. I’d like to add or remove the background colour of
$featurette_list .= "\t<div class='row featurette-wrap'>";Great advice Senff, thanks.
Sometimes having someone else talk about your situation can really help to clarify what you think yourself!
I agree. When the style and functionality are the same across all subjects that you wish to publish on your site then default categories is the way to go. When you are publishing very different sets of material then that’s where CPTs come in.
In Reply to Iaraib110, first of all thanks for your input. I agree, it does depend very much on your situation and I also like to keep things simple. Generally everything that is in the core of wordpress is simple when you know how. Including custom post types.
If anyone else would like to add their opinions, please do!