Add colorpicker to featured image

Okay. Got it working…. I used the simple version: add_filter( ‘admin_post_thumbnail_html’, ‘basic_add_opacity_to_feature_thumb_box’); //same as before function basic_add_opacity_to_feature_thumb_box( $myhtml ) { $selected_option = get_post_meta( get_the_ID(), ‘basic_opacity’, true ); // get the current value for ( $i = 0; $i <= 1; $i = $i + 0.1 ) { //loop from 0 to 1 in 0.1 increments … Read more

how to get the comment ID in the front end when the REPLY button is clicked?

Here are few ideas: It’s possible to inject custom HTML or data attributes via the comment_reply_link filter, but I think it would be better to keep it unobtrusive. One could try to get the comment parent value from the reply comment form: <input type=”hidden” name=”comment_parent” id=’comment_parent’ value=”0″ /> after it has been updated with the … Read more

Updating User Profile with AJAX not working

This whole thing works as far as I can tell. In the future it may be easier to debug things by using PHP error_log() to write to the debug.log at certain points, like inside your ajax callback. If you’re only wanting to run this ajax for logged in users, you can drop the wp_ajax_nopriv hook … Read more

trigger(‘change’) not working

To use a custom control, you need a field with special attributes to be linked to the “publish” button. if you don’t want to display this field, you can generate a hidden field like that : class WP_Test_2_Customize_Control extends WP_Customize_Control { public function render_content() { ?> <input id=”<?php echo htmlspecialchars(“_customize-input-{$this->id}”);?>” type=”hidden” <?php $this->input_attrs();?> <?php if … Read more

Modify this loop to fit my jQuery slider (slides)

Tried very simple math. <div class=”slide”> will print after every 4 post. So, if statement with old school logic $i%4 == 0 <div class=”slides_container”> <?php $args = array( ‘post_type’ => ‘fastighet’, ‘numberposts’ => -1, ‘orderby’ => ‘ASC’ ); $posts = get_posts($args); ?> <?php $i = 0; foreach($posts as $post): ?> <?php if($i%4 == 0): ?> … Read more

Ajax pagination works only first and third time

@kennypu in stackoverflow saved my life with this: t’s because you’re changing the contents of #paginar, so what happens is the event on the links are getting cleared. depending on your jquery version, you can either use .live() or add the even to the #pagi-container instead: $(‘#pagi-container’).on(‘click’,’#paginar > a’,function() {… } my finished code is … Read more

jQuery Validate wp_editor

Per the jQuery noConflict Wrappers section of the wp_enqueue_script() Codex page, the $ variable is not available in WordPress. You can replace $ with jQuery in your jQuery code, or do something like this: jQuery(document).ready(function($) { // your code here . . . });

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