how to run a php code in widget?

Try this with or without the return. $object_terms = wp_get_object_terms($GLOBALS[‘post’]->ID, ‘staff’, array(‘fields’ => ‘all’)); if ($object_terms) { echo ‘<p>’ . ” . ” ; $res=””; foreach ($object_terms as $term) { $res .= ‘<a href=”‘ . esc_attr(get_term_link($term, $taxonomy)) . ‘” title=”‘ . sprintf(__(“View artiles of: %s”), $term->name) . ‘” ‘ . ‘>’ . $term->name . ‘</a>, … Read more

How to include a hyperlink in the body text of a custom password protected form?

I assume the code you added to functions.php is a filter for ‘the_password_form’, where you’ve got something like: function my_protected_post_form () { $myCustomizedFormCode=”<form action=….” return $myCustomizedFormCode; } add_filter (‘the_password_form’, ‘my_protected_post_form’); So where you have the instructions to the user in that custom form code string, you just need some simple HTML to provide the link … Read more

How to implement custom Javascript to my site

Consider using the Localize script in WordPress <?php // Register the script wp_register_script( ‘some_handle’, ‘path/to/myscript.js’ ); // Localize the script with new data $translation_array = array( ‘some_string’ => __( ‘Some string to translate’, ‘plugin-domain’ ), ‘a_value’ => ’10’ ); wp_localize_script( ‘some_handle’, ‘object_name’, $translation_array ); // Enqueued script with localized data. wp_enqueue_script( ‘some_handle’ ); You can … Read more

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