Theme editing “post thumbnail” help

Well, I have set the featured image or any other from post with this code: Get the image $image_id=get_post_thumbnail_id(get_the_ID()); $image_url = wp_get_attachment_image_src($image_id,’full’); $image_url=$image_url[0]; Set the image as background <div id=”full” class=”full float-left” style=”background-image:url(<?php get_image_url(); ?>);”> Your content here. </div> Next, one example I made few years ago taking the image from random post, the image … Read more

How save data on user’s client cache

wp_cache_* methods are cached in either php memory or an object cache ( if available ) . It will never be available to be saved in the browser. If you want to save it on the browser side, you’ll need to use JavaScript. Local or Session storage are great for that https://caniuse.com/#feat=namevalue-storage

Create unordered list from custom field type entires separated by a comma

If I understood you correctly, this should be pretty straight forward: $rawcontent = get_field(“myfield”); $rawcontent = preg_replace(“!</?p[^>]*>!”, “”, $rawcontent); // remove <p> $all_links = preg_split(“/\s*,\s*/”, $rawcontent); foreach($all_links as $link) { if(!trim($link)) continue; print “<li>$link</li>”; } A comma certainly would work, but note that this would break if you had commas inside the link text (<a … Read more

My WP Website Shows HTTP ERROR 500

For future reference you could use the define( ‘WP_DEBUG’, true ); at your wp_config to easily spot errors and turn to false when you are done. Enabling WP_DEBUG will cause all PHP errors, notices and warnings to be displayed. This is likely to modify the default behaviour of PHP which only displays fatal errors and/or … Read more

WooCommerce Custom Tab with ACF Repeater Field

I believe you need to use get_sub_field() for the repeater field (designer_achievements) and get_field() for its parent. Please take a look at the ACF documentation for the Repeater field’s subfield. You will also need to use a have_rows() loop, as noted in the documentation. if( have_rows(‘parent_field’) ): while( have_rows(‘parent_field’) ) : the_row(); $value = get_sub_field(‘sub_field’); … Read more

(Who to follow) Twitter widget

It looks like you’re saving a PHP std object in the database. It might be an array, I’d have to check how WordPress saves those. In either case: If you’re using add_user_meta() or update_user_meta() to insert the user meta into the database (and you should be), then using get_user_meta() with the third parameter set to … Read more