Tag Info

Hot answers tagged

2

You should be able to keep the wpadminbar from overlaying your navigation bar by using either JavaScript or a combination of PHP and CSS. I would add this php to the header.php file of your theme: <?php if ( is_admin_bar_showing() ) { ?> <style> .my-nav-bar { position: absolute; top: [wpadminbar-height]px; ...


2

WordPress has a class it outputs if you're using the body_class() function (which you should be!) that indicates if the admin bar is showing: admin-bar. Therefore, there's no php or JS needed. I'm assuming you're using position: fixed; for the .navbar-fixed-top. If so, just add this to your theme's stylesheet: .admin-bar .navbar-fixed-top { top: 32px; ...


1

You can just simply create a custom query with WP_Query. You just need to make sure if you are using a custom taxonomy or the build-in category. For reference, see: Is There a Difference Between Taxonomies and Categories? Here is an example for custom taxonomies (this can also be used for build-in categories, just change 'taxonomy' => ...


1

It seems the problem was it wasn't recognizing it was a page in the first place and thus couldn't recognize if there was a template applied to it. Changed if (is_page_template('page-templates/page-nosidebar.php')) { to if (is_page() && !is_page_template('page-templates/page-nosidebar.php')) {


1

You were nearly there with your first piece of code. For this to completely work, you'll need to get a list of the comment classes and check your class against that list. If your class exists in that returned list, you can something, if not, do something else Use get_comment_class() to retrieve that list. Here is an example $classes = get_comment_class(); ...


1

OK, you have two problems here. Firstly, you are enqueueing your style with wp_enqueue_script(), which is meant to be used by scripts. You should be using wp_enqueue_style Secondly, you need to understand what functions are loaded when. Plugins are loaded first, child themes second and parent themes last. So you styles gets loaded first, and then the ...


1

You don't need to create additional functions, just re-use what you already have and tweak it a bit: function theme_add_bootstrap() { wp_enqueue_style( 'bootstrap-css', get_template_directory_uri() . '/third_party/bootstrap/css/bootstrap.min.css' ); wp_enqueue_script( 'bootstrap-js', get_template_directory_uri() . ...


1

@Clemzd First off you @font-face css is missing a few lines that are required for a font to work correctly across all browsers and platforms. You only have one src url in your @font-face css. Take a look at how my @font-face css is written. My font files are inside a folder called fonts inside the folder of my child theme where I have WP installed on my ...



Only top voted, non community-wiki answers of a minimum length are eligible