Embeding style into the header via the function.php

You are not escaping your PHP correctly. In this part $output=”… <?php You could instead do it like this: add_action(‘wp_head’,’hook_css’); function hook_css() { ?> <!– Closing the PHP here –> <style> body { background-repeat: no-repeat; background-attachment: fixed; background-size: 100% 100%; background: url(‘../images/backgrounds/bg<?php echo rand(1,4); ?>.jpg’) no-repeat top center; } </style> <?php //Opening the PHP tag … Read more

Hook Adding content after title

Use in_the_loop() to know if you are currently in the loop of the main query. function after_title($title) { if ( in_the_loop() && ( is_single() || is_page() || is_home() || is_category() ) ) { $write=”AFTER TITLE”; $title = $title.$write; } return $title; } add_filter( ‘the_title’, ‘after_title’ );

Hook priority in admin with custom plugin

The codex entry you site is simply wrong! There are a lot of hooks fired before admin_init during admin requests, not least of which is init, which a lot of plugins use to do their initialization. In particular, the TGM Plugin Activation plugin hooks into init (with the default priority = 10) with a function … Read more

Hook function prints output twice

You don’t need to add do_action(‘create_amenities’, $new_term_id);. The created_{$taxonomy} hook fires after a new term in a specific taxonomy is created by default.

Convert Gravity Form Entry Date on Export

You can’t modify date_created on Export Gravity Forms date_created field isn’t actually a field that’s affected by that hook. If you look in /exports.php you’ll find in start_export() that they bypass the filter for ID’s date_created and payment_date and hard-code force the use of Y-m-d H:i:s foreach ( $leads as $lead ) { GFCommon::log_debug( __METHOD__ … Read more

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