if statement for featured images

The second if statement requires it to be a post, so a 404 page won’t pass. I’d re-do it like this, using elseif statements. I also changed $thumbnail->ID to $post->ID since the former was not defined. add_action( ‘genesis_before_header’, ‘minimum_featured_image’ ); function minimum_featured_image() { global $post; if ( is_home() ) { echo ‘<div id=”featured-image-home”>’; echo get_the_post_thumbnail($post->ID, … Read more

PHP inside echo HTML?

You can concatenate strings with the result of a php function: echo ‘<div id=”bg” style=”background:url(‘ . get_stylesheet_directory_uri() . ‘/assets/img/header_2.jpg);”>’; Codex: get_stylesheet_directory_uri()

Auto-Tagging a Custom Post Type

Referenced from https://codex.wordpress.org/Post_Status_Transitions#.7Bstatus.7D_.7Bpost_type.7D_Hook the hook named “{status}_{post_type} Hook”. This hooks is fired, when custom post type “community” is giving the status “publish” = is published. Hook will give post_id and post object as parameters to the callback function. And wp_set_post_terms, requires first parameter as post ID. This should work: add_action(‘publish_community’, ‘community_post_type_tagging’, 10, 2); function community_post_type_tagging($post_id, … Read more

From my Plugin Settings Page use check boxes to load specific css files (e.g. Bootstrap / Foundation)

You will have to create a settings page on which you will have to register your settings. Unfortunately this is no easy task, but it has been very well documented on tutsplus. Once you have implemented the settings api, you can check for the options that have been set with your settings page. Depending on … Read more

Displaying message if no posts in tag

Well, it seems as if you are using loop functions but you don’t have a loop. So I’ve altered your code to include the loops, since it is integral to my particular solution. <?php /* Template Name: Archives */ get_header(); ?> <div id=”container”> <div id=”content” role=”main”> <?php if(have_posts()) : while(have_posts()) : ?> <?php the_post(); ?> … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)