Why does WP load so many files in the head of source code? How do I optimize it?

First of all, search this site. This questions has been answered many times in the past: https://wordpress.stackexchange.com/search?q=clean+wp_head and https://wordpress.stackexchange.com/search?q=security+obscurity Secondly, there is a difference in what WP loads and what a theme and a plugin will load. Look in the theme functions file to see what the theme loads, i.e. javascripts and CSS. Look in … Read more

Rotate images in header based on date

The following code will cycle between the 9 pics. 1st day of the year = pic0, 2nd = pic1…359th = pic9, 360th = pic0, etc. <?php $pic_array = array( ‘pic0’, ‘pic1’, ‘pic2’, ‘pic3’, ‘pic4’, ‘pic5’, ‘pic6’, ‘pic7’, ‘pic8’, ); $d = (int) date(‘z’) % 9; $todays_pic = $pic_array[$d]; echo $todays_pic; Hopefully you’re not changing a … Read more

Why does WordPress allow inserting tags into posts?

It is my understanding that there should not be more than one <h1> tag on a page, and that the <h1> tag should be the site title, for SEO reasons. But that’s your opinion, not a rule. From an accessibility perspective the h1 should be used for main content’s title, on a single page that … Read more

H1 tags for header image?

try is_front_page() conditional function <?php } else { ?> <hgroup> <?php $is_front_page = is_front_page() ? ‘h1’ : ‘h6’; ?> <<?php echo $is_front_page ?> class=”site-title”><a href=”https://wordpress.stackexchange.com/questions/88142/<?php echo home_url(“https://wordpress.stackexchange.com/” ); ?>” title=”<?php echo esc_attr( get_bloginfo( ‘name’, ‘display’ ) ); ?>” rel=”home”><?php bloginfo( ‘name’ ); ?></a></h1> <h2 class=”site-description”><?php bloginfo( ‘description’ ); ?></h2> </hgroup> <?php } ?> Edit To … Read more

How to Access Script Tags in Header

If done right there should be a callback hooked to wp_enqueue_scripts which has either wp_enqueue_script or both wp_register_script and wp_enqueue_script in it. Something like the following from the Codex: function themeslug_enqueue_script() { wp_enqueue_script( ‘my-js’, ‘filename.js’, false ); } add_action( ‘wp_enqueue_scripts’, ‘themeslug_enqueue_script’ ); You will need to find that callback function in your theme or in … Read more

My header not showing up [closed]

Simply having a header.php in your theme’s folder will not output your header to the browser. You have to call the header too. To call the header.php file, you should use get_header(); at the top of almost every template (Almost!) such as page.php, single.php, archive.php and so on. Do the same for footer.php to get … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)