buildlab
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Can someone help me setup Windows Server 2012 R2?So the install on Apache is simpler?
Forum: Fixing WordPress
In reply to: Can someone help me setup Windows Server 2012 R2?What does the extra work involve?
My work uses Windows Server which is why I want to run it.
Forum: Fixing WordPress
In reply to: Can someone help me setup Windows Server 2012 R2?Why is it a bad idea?
Forum: Localhost Installs
In reply to: Help getting setup on Windows Server 2012 R2Well, I kind of want to do it myself because I want to learn how to do it.
Ok, I got it to work. I looked up the category ID and used this…
function exclude_category( $query ) { if ( $query->is_home() && $query->is_main_query() ) { $query->set( 'cat', '-14' ); } } add_action( 'pre_get_posts', 'exclude_category' );
Ok, I now have this and its not working…
function exclude_category( $query ) { if ( $query->is_home() && $query->is_main_query() ) { $query->set( 'category_name=video' ); } } add_action( 'pre_get_posts', 'exclude_category' );
And its giving me this error…
Warning:Missing argument 2 for WP_Query::set(), called in /home/rhemox/buildlab.xyz/wp-content/themes/buildlab_childtheme_20_14/functions.php on line 23 and defined in /home/rhemox/buildlab.xyz/wp-includes/query.php on line 2369
Well that didnt work.
Heres what I have in the functions.php file…
<?php // // Recommended way to include parent theme styles. // (Please see https://codex.www.ads-software.com/Child_Themes#How_to_Create_a_Child_Theme) // add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array('parent-style') ); } // // Your code goes below // // START To remove category of video showing on posts page function exclude_category( $query ) { if ( $query->is_home() && $query->is_main_query() ) { $query->set( 'cat', '-video' ); } } add_action( 'pre_get_posts', 'exclude_category' ); // END To remove category of video showing on posts page
Heres a link to the site… https://www.buildlab.xyz/
Thanks for the response.
So it seems like excluding posts with category “video” from posts page makes the most sense.
So would I just copy and paste this code anywhere in the functions.php file?
function exclude_category( $query ) { if ( $query->is_home() && $query->is_main_query() ) { $query->set( 'cat', '-1,-1347' ); } } add_action( 'pre_get_posts', 'exclude_category' );
But replace the example above’s category to be excluded with my “video” category?
Forum: Fixing WordPress
In reply to: How to make video post appear in sidebar only?Cool. That did it. Thanks.
Thanks for the response.
Um, what is a custom CSS plugin? Sorry, I’m a complete noob to WordPress. And still a general noob to web development.