Cannot figure out what element header color is in wordpress theme [closed]

You can use your browsers Inspector via it’s Developer Tools to hover-and-reveal the class andor id name(s) of all html elements on a webpage. Here’s some links to popular browsers and how to get started with the tool https://developer.chrome.com/devtools https://developer.mozilla.org/en-US/docs/Tools/Page_Inspector https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/Web_Inspector_Tutorial/EnableWebInspector/EnableWebInspector.html For your site, I believe css of #site-navigation { background: black !important; } will … Read more

My Custom Post Type Still Using index.php

It looks like your theme is missing certain key files that are needed in order to keep WordPress from defaulting to index.php per the WordPress Template Hierarchy. Since you have defined your portfolio post type to act like posts by setting ‘hierarchical’ to false, you should probably be using the post custom template files. In … Read more

Different CSS class by category

If your template uses the function post_class() in it then your posts already have category-based classes applied to them in the HTML. In PHP, it often will look like this: <article id=”post-<?php the_ID(); ?>” <?php post_class(); ?>> For example, say you have a category of news, then posts that are in it will have a … Read more

Menu Custom Data Attributes

If you want to add a custom data attributes to the menu that’s generated by wp_nav_menu function. You can use the nav_menu_link_attributes filter to add the desired attributes to the <a> elements. function add_menu_atts( $atts, $item, $args ) { $atts[‘data-hover’] = $atts[‘title’]; // add data-hover attribute return $atts; } add_filter( ‘nav_menu_link_attributes’, ‘add_menu_atts’, 10, 3 );

Load custom CSS before admin CSS

By default they should already be loading after the core admin styles. I suspect the CSS isn’t even being loaded because you have an invalid parameter in your wp_enqueue_style() call. Its parameters are the same as wp_enqueue_script(). Where you have 99 is where dependencies are actually defined. So WordPress is looking for 99 to be … Read more

I can’t add CSS with functions.php

Before adding any file you must seperate your header.php file & add wp_head() function in header.php file // Load the theme stylesheets function theme_styles() { // Example of loading a custom css file for homepage just on the homepage wp_register_style( ‘custom’, get_template_directory_uri() . ‘/css/custom.css’ ); if(is_page(‘home’)) { wp_enqueue_style(‘custom’); } // Example of loading a main … Read more

After moving my site, sub-menus are not showing [closed]

For some reason, your header is being wrapped in the div with the class “page-wrap”, which should go around the whole page (that’s what is does on the working WooCommerce page). If you go into your inspector and uncheck “overflow:hidden” on the div with the class ‘page-wrap’, the menu starts working. Maybe check your header … Read more

How to Add a Read-only Textbox With Text in it That Has a Button to Copy it?

Here is a simple example from w3 schools that uses a bit of JS to copy the value of a input field. <input type=”text” value=”StackExchange WordPress” id=”myInput”> <button onclick=”myFunction()”>Copy text</button> <p>The document.execCommand() method is not supported in IE9 and earlier.</p> <script> function myFunction() { var copyText = document.getElementById(“myInput”); copyText.select(); document.execCommand(“Copy”); alert(“Copied the text: ” + … Read more

Acessing HTML element with no specific tag on it [closed]

Your <h3> isn’t closed. The Proper Way: The real way to fix it would be fixing the PHP. In one of your template theme files you’ll have <div class=”post-header”> <?php echo get_the_date(); ?> <h3 class=”title”> <?php the_title(); ?> <h3> </div> You’ll want to delete the get_the_date() line. If your theme is from an author that … Read more