Create special button on WP Tiny MCE Posts Editor for Shortcodes

Your functions have nothing to do with each other. Is all you want a button that when clicked adds [tooltips class=”top_tooltip” title=”Your Tooltip here”] Text here [/tooltip] to the editor? — This is currently what your doing — First Function: function tooltip( $button ) is adding your tooltip shortcode Second Function: mce_tooltip( $button ) is … Read more

Check in which custom taxonomy belongs and change the style

has_term must be used inside the loop. If you use it outside the loop you have to pass the post ID or post object you want to check. In the single.php file put your code inside the loop to check the current post: <?php get_header(); while(have_post) { the_post(); ?> <div class=”non-home-parallax product-listing-parallax” style=” <?php if( … Read more

Accessing an API with jQuery and AJAX

There are a few things going on with your functions.php file that may be the issue. You should be using wp_enqueue_scripts action to enqueue your script. The first parameter of wp_localize_script() should match the id of the file you’ve enqueued. You also need to add a no_priv version for your Ajax call if it needs … Read more

Cannot modify header information – server cache

It means WordPress is outputting something to the browser too early. The file indicated seems to be your own session file (php stores user sessions in small text files in the tmp directory). Check first the wp-config.php file. Remove the final closing php tag. Make sure you’re not outputting anything in that file (look for … Read more

Generate responsive post thumbnails of same size

Install plugin: https://wordpress.org/plugins/force-regenerate-thumbnails/ and regenerate all thumbnails. Or steps: Create new dimension for images: add_image_size (‘thumb-cropped’, 227, 133, true); // Set necessary sizes (true = cropped) Get images with the sizes in you function. get_the_post_thumbnail($post->ID); fix to: get_the_post_thumbnail($post->ID, ‘thumb-cropped’); Install plugin: https://wordpress.org/plugins/force-regenerate-thumbnails/ Inter in admin area and regenerate all thumbnails The end. Use all new … Read more

Child Theme’s Read More Text

As this line of code is hardcoded in the index.php file rather than called via a function you only really have two options: Write your own function to call this code (with your chosen read more text), then replace the relevant section in the child theme’s index.php file with a call to this function. The … Read more

Creating a Category Taxonomy

I would really suggest using one custom post type and one custom taxonomy with terms under the custom taxonomy which is assigned to a show. This structure will function exactly like normal posts with normal categories, the only difference is that it will be outside the scope of default blogging as custom post types are … Read more