Archive page if else not working for post_excerpt and post_content

Apart from the horribly format issues you also have a typo: <?php $my_excerpt = $item->post_excerpt; if ($my_excerpt){ echo Str::limit($my_excerpt, 120);} else $content = ($item->post_content);{ $contentexcerpt = substr($content, 0, 150); echo $contentexcerpt, ‘…’; } ?> These lines: else $content = ($item->post_content);{ should be: else { $content = ($item->post_content); The parser registered a single line of code … Read more

blank page when trying to change upload directory

You need a better function, your paths are broken – see this answer for reference: function wpse_16722_type_upload_dir( $args ) { if ( ! empty( $_REQUEST[‘post_id’] ) && $post_id = absint( $_REQUEST[‘post_id’] ) ) { if ( $post = get_post( $post_id ) ) { if ( $post->post_type !== ‘attachment’ ) { $args[‘subdir’] = “/$post->post_type”; // Must … Read more

If else statement based on referral URL

a $_GET variable would be the better option. try var_dump($_GET); on the page before the conditional and see exactly what you need to test against It seems that there is something more to the puzzle that we are missing. Is the file not showing up correctly? Could that be because the file paths are wrong? … Read more

My customizer’s setting doesn’t set to the default and needed to click the control’s “Default” button before it’ll be set

As what I’ve commented, the rawurlencode() function is the reason because WordPress have a lot of restrictions. I found that, that kind of problem will exist if you have a % percent sign (in my case, produced by the rawurlencode()) in your ‘default’ => $value. One of the solutions, encode some or the whole part … Read more