Help with a function in a widget

First, if meta key is isbn_metadata is the meta_key you should specify this meta key instead of _isbn. Second, get_post_meta return an array unless you set the third parameter to true. So, you can do this: function get_kalahari_affiliate_link() { $isbn_metadata = get_post_meta( get_the_ID(), ‘isbn_metadata’, true ); if( ! empty( $isbn_metadata ) ) { $link = … Read more

Building a plugin into a theme

Just because you think that you have to do it doesn’t remove the fact that it is very not smart to do it. The plugin code is built to be used as a plugin and not as a theme, and while you can copy parts of the code and use them in the theme there … Read more

Featured Image in RSS Feed

You can use the get_post_thumbnail_id to get the ID of the thumbnail, then with the function wp_get_attachment_image_src you can get the image of the size you want, including full size, using the second paramenter. $thumb_id = get_post_thumbnail_id(get_the_ID()); $thumb_data = wp_get_attachment_image_src( $thumb_id, ‘full’); Now in $thumb_data you have a nice array, or false if there’s no … Read more

Show related posts based of current ACF field name in a single page post (a loop within loop)

You don’t have a meta_value in your query. From your code I can’t tell what you’re doing with the meta values but you should be able to do this: // Store this BEFORE you go into the second loop. $category = get_field(‘category’); // The arguments for the second loop ‘post_type’ => ‘case-studies’, ‘showposts’ => 3, … Read more

wp_ajax action responds with 0

Change your wp_localize_script-Call to the right Action: wp_localize_script( ‘addItemToNav’, ‘menuItems’, array( // URL to wp-admin/admin-ajax.php to process the request ‘ajaxurl’ => admin_url( ‘admin-ajax.php’ ), // generate a nonce with a unique ID “myajax-post-comment-nonce” ‘postCommentNonce’ => wp_create_nonce( ‘update_nav_items-nonce’ ), ‘action’ => ‘wp_ajax_update_nav_items’ ) ); As ‘action’ you currently Input the function Name, but that is wrong. … Read more

How to add img into a plugin?

<?php echo ‘<img src=”‘ . plugins_url( ‘img/image.png’, __FILE__ ) . ‘” > ‘; ?> here is the link how to add images or any other files from plugin folder http://codex.wordpress.org/Function_Reference/plugins_url

Get access to WordPress when logged out

So the plugin mishaps are blocking you from signing into the dash? You will likely need server access or someone who has this access if you’re not using version control. You can just rename the folder for the plugin that you want to de-activate (BBPress Like Button). That will force it to de-activate since the … Read more