PHP include statement not working?

From your current code you do not need to include functions.php, it is automatically done Because get_1406_page_title() returns it’s output, you need to echo the result from the function if you need to display the result echo get_1406_page_title();

Jquery window.send_to_editor function

It is just a little syntax error in your window.send_to_editor function: imgurl = $( ‘img’, html ).attr( ‘src’ ); should be imgurl = $( ‘img’, $( html ) ).attr( ‘src’ ); because your html variable is neither a valid DOM nor a jQuery Element. Additional Note: If you want to use the Thickbox on multiple … Read more

Division by zero error in image.php

shutter speed is one of the exif data wordpress tries to extract from images when uploaded. If the image do not contain the info it will be zero, hence your division by zero error. Somewhere before that code you should check if the image even needs to go there. If it is not a photo … Read more

Is it possible to define variables in a wordpress shortcode, and then call the shortcode using a specific variable?

I think you are looking for this- function star_rating( $atts ) { $max = 5; $atts = shortcode_atts( array( ‘grade’ => $max, // default ), $atts ); $star_icons=””; $full_star = floor( $atts[‘grade’] ); for( $i=1; $i<=$full_star; $i++ ) { $star_icons .= ‘<i class=”fa fa-star”></i>’; } $half_star = 0; if( (int) $atts[‘grade’] != $atts[‘grade’] ){ $half_star … Read more

Foreach inside foreach

First, I’d extract all the slugs of the recommended colour terms with something like this: $recommended_colours = wp_get_post_terms($post->ID, ‘recommended_colours’); $recommended_colour_slugs = array_map(function($colour) { return $colour->slug; }, $recommended_colours); … which leaves you with a $recommended_colour_slugs array that looks like this [‘blue’, ‘green’]. Then you can loop over your colour terms and use an if-else to check … Read more

WordPress archive page showing 404 Error [duplicate]

You should mention register function in your Question. Add flush_rewrite_rules( false ); in Your custom_post_type register function. it is necessary when you are creating custom post with archive. example code: function create_my_post_type(){ register_post_type(‘MyPost’, array( ‘labels’ => array(‘name’ =>__(‘My-custom-Post’),’singular_name’ => __(‘my-post’)), ‘rewrite’ => array(‘slug’ => ‘MyPost’,’with_front’ => true), ‘public’=>true, ‘has_archive’ => true, )); flush_rewrite_rules(false); //recreate rewrite … Read more