How to refresh a page from jquery [closed]

jQuery(document).ready(function ($j) { $j(‘#wp_button’).on(‘click’, function() { var data = { action: ‘response’, myid: ajax_var.mypostid, ajaxvar: variable, }; $.post(ajax_var.ajaxurl, data, function(response) { alert(response); location.reload(); }); return false; }); });

How to make a conditional statement within $output in shortcodes.php?

If I understand you right you just want to use a ‘?’ type of if statement: $output=”<div class=”w-blog-entry” style=”padding:0;”> <div class=”w-blog-entry-h”> <div class=”l-subsection color_dark” style=”background-image: url(“.$the_thumbnail.’); background-position: center center; padding-top:0; padding-bottom:0; background-attachment: inherit;”> <div class=”l-subsection-h”> <div class=”l-subsection-hh g-html i-cf” style=”font-family:Century Gothic; text-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);”> <a class=”w-blog-entry-link” href=”‘.get_permalink(get_the_ID()).'”><h2 class=”w-blog-entry-title” style=”line-height:1em; margin-left:0; … Read more

Changes made on php.ini have no effect on wordpress

Not sure if i can ask clarification using answer feature in here, but… @Marcel, it’s not clear what “wordpress just don’t see it” means a) Avada’s Server Environment page shows a PHP Memory Limit or b) a lower WordPress Memory limit? I am guessing is b). In this case, have you edited wp-config.php and increased … Read more

Get the featured image url of clicked post

It seems you are using this outside the loop then use get_the_post_thumbnail to get the featured image for any post by supplying post id. So your code will become this. <?php if ( has_post_thumbnail() ) { echo ‘<a href=”‘ . get_permalink( $post->ID ) . ‘” >’; echo get_the_post_thumbnail( $post->ID, ‘my_feature_image’, array( ‘class’ => “someName” ) … Read more

How to get thumbnail with pure PHP in a WordPress database?

Okay, a couple of things – first I would suggest modifying your main query to grab the thumbnail ID at the same time (I have also changed it to only get posts that have a thumb): $sql = “SELECT wp_posts.*, meta_value AS thumbnail_id FROM wp_posts ” . “LEFT JOIN wp_postmeta ON wp_posts.ID = wp_postmeta.post_id ” … Read more

WordPress İmages Upload & Delete Error

opendir operates on directories on a filesystem, not HTTP URIs. While some HTTP URIs return directory listings (the one you are using doesn’t, it is a 404 error), those listings as HTML documents generated by the webserver and are not actual directories. So please change value of $directory variable. For Example: Current value in $directory … Read more

Custom upload folder

Use something like this function, you need to set condition for if(user==admin) and then if(post-type==’some-post-type’): function wpse_16722_type_upload_dir( $args ) { // Get the current post_id $id = ( isset( $_REQUEST[‘post_id’] ) ? $_REQUEST[‘post_id’] : ” ); if( $id ) { // Set the new path depends on current post_type $newdir=”https://wordpress.stackexchange.com/” . get_post_type( $id ); $args[‘path’] … Read more