• Resolved SEOWebDesignLLC

    (@seowebdesignllc)


    I need help making default images for each of my categories. I tried your snippet of php code for the functions file, but it seemed to break the site. Here is the snippet I pasted at the end of my functions.php file:

    function dfi_category( $dfi_id ) {
      if ( has_category( 'commodities' ) ) {
        return 157531; // the image id
      } else if ( has_category( 'dividends-income' ) ) {
        return 157533; // the image id
      } else if ( has_category( 'etfs' ) ) {
        return 157540; // the image id
      } else if ( has_category( 'forex' ) ) {
        return 157543; // the image id
      } else if ( has_category( 'investing' ) ) {
        return 157549; // the image id
      } else if ( has_category( 'market' ) ) {
        return 157553; // the image id
      } else if ( has_category( 'personal-finance' ) ) {
        return 157560; // the image id
      } else if ( has_category( 'real-estate' ) ) {
        return 157563; // the image id
      } else if ( has_category( 'retirement' ) ) {
        return 157571; // the image id
      } else if ( has_category( 'stocks' ) ) {
        return 157575; // the image id
      } else if ( has_category( 'trading' ) ) {
        return 157578; // the image id
      } else if ( has_category( 'us-world-news' ) ) {
        return 157730; // the image id
      }
      return $dfi_id; // the original featured image id
    }
    add_filter('dfi_thumbnail_id', 'dfi_category' );

    Please help!

    http://wordpress.org/plugins/default-featured-image/

Viewing 4 replies - 16 through 19 (of 19 total)
  • Thread Starter SEOWebDesignLLC

    (@seowebdesignllc)

    Told you I was new to WP. I find all sorts of stuff when I have no idea what I am looking for exactly.

    …and that’s all it took so make sure to let it be known, use the THEME’s functions.php file…and no other(s)!

    Thanks for all of your help and quick feedback.

    -The End-

    Plugin Author janw.oostendorp

    (@janwoostendorp)

    So it worked?

    Hint:
    the WordPress codex has a lot of information about all these things.

    Including building your own theme
    General tip: don’t try to figure stuff out yourself, Google everything you are not certain about. WordPress has a lot of information all across the web. You will find your answers there.

    Thread Starter SEOWebDesignLLC

    (@seowebdesignllc)

    Yes it worked.

    Hint:
    Just clarify exactly WHICH functions.php needs to be edited in your FAQs because I promise that Google nor the WP codex would tell me THAT!

    Thanks again for all of your help…and expert advice!

    Plugin Author janw.oostendorp

    (@janwoostendorp)

    I’ll note that. It is so common knowledge for me easy to forget. Also because it is the first step in WP theming.

Viewing 4 replies - 16 through 19 (of 19 total)
  • The topic ‘Category Featured Image’ is closed to new replies.