CatPIC – Ad code to theme | WordPress Category Post Info plugin

Wordpress Category Post Info plugin

WordPress Category Post Info plugin

For controlling the post information for different categories.

CatPIC (Category Post Info Control) will work “out of the box” with the Genesis Framework. However, if you’re using any other theme, you need to add some code to the theme.

UPDATE:
I thought all themes had the same files, but turns out they don’t.  So there’ll be a different fix for each one. As me and  my wife only use Genesis child themes, it’s not worth my while to investigate how to update every possible theme out there, but I am willing to help where I can.

Search the comments of this post for your theme name. If it’s not listed, ask me and I’ll check it out for you.

For the TwentyEleven theme, add two lines of code to your content-single.php page.

* – Open the content-single.php page for your theme.
* – Find the line or lines where the byline is displayed (see sample below)
* – Put the following line above the byline
<?php if (true == cat_p_i_c_show_post_info(get_the_ID())) :? >
* – and put the following code below the byline
<?php endif; ?>

As an example, here is what the code should look like in the Twenty Eleven theme. The green code was the existing code to display the byline and the yellow lines are what I’ve added to make CatPIC work with this theme.

wordpress-hide-byline

 

Comments

  1. i dont find any content-single.php in my theme folder. am i missing something?
    i am using WordPress 3.4.1

    • HusbandHunterDad says:

      Hi Clockman,

      Are you sure you’re looking in the right place? It should be a specific theme under the Themes folder, like this:

      wordpress byline

      If you don’t see it there, let me know what theme you’re using.

      Cheers,

      Dirk

  2. i am using a non genesis theme.
    rebrand is my theme and i dont see any content-single.php in the theme’s folder

    • HusbandHunterDad says:

      Sorry Clockman, I just learnt that not all themes have that file.

      Can you please send me the single.php and (if there is one) the loop-single.php files from your theme, then I’ll find where to make the change and do it for you.
      reBrand is a paid theme, so unfortunately I can’t get the theme to check it out myself.
      My email address is “dad@[this website's domain]”

      My apologies for the inconvenience.

  3. HusbandHunterDad says:

    Hide post info for Rebrand Theme:

    To make the plugin work for the rebrand theme, open the file includes\theme-actions.php and search for function otw_post_meta()
    Add the following line to the top of that function
    if (!cat_p_i_c_show_post_info(get_the_ID())) { return; }

    So that your code looks like this:

    if ( ! function_exists( ‘otw_post_meta’ ) ) {
    function otw_post_meta() {

    if ( is_page() ) { return; }

    if (!cat_p_i_c_show_post_info(get_the_ID())) { return; }

  4. Hello,

    I just downloaded Category Post Info Control but I do not see any functions for it within my Categories. I am using Magazine Basic. I know I probably have to add code to my content-single.php

    Sorry, I am not proficient in adding content-single.php page changes so I would need to easily copy and past that code. I’m not able to view your Ten Twenty example as the image is broken;not showing on this page. Much thanks.
    Hillary

    • HusbandHunterDad says:

      Hi Hillary,

      Yes, I apologize. It’s not that easy for themes other than Genesis child themes.
      I have downloaded Magazine Basic version 2.7.9 and applied the changes in there. In that theme the change happens to be in loop.php. I’ve made the change for you… just hold on.
      Can you download this file and unzip it into your wp-content\themes\magazine-basic folder.
      loop.zip

      Or if you want to do it yourself, you need to add the two highlighted lines in loop.php

      Having said all that, you don’t need to have done anything to your theme to see the option within the Admin Control Panel. If you’ve installed and activated the plugin, then you should see the Category Post Info Control section with a single checkbox when you edit an existing Category.
      So in Admin control panel, go to Posts / Categories and edit an existing category. You should then see this somewhere on the page:

      hope that helps.

      Dirk

      • Hi Dirk,

        I followed your instructions and it worked. I finally realized I had to select and edit my post from within the Categories screen. Much thanks!

        Hillary

  5. I’m using the Watson theme by theme foundry and sorely need your plugin because I often repost and don’t want my byline under the headline. I want to have a category for reposting that would say “Posted by Editor.” Can you help me with this? I have racked my brains (I am new to wordpress) trying to figure out how to have this flexibility in my theme. Your plugin comes the closest to helping me do this. Many thanks for any and all help you can provide me. My website is freespiritrising.com.
    Mary Ann

    • HusbandHunterDad says:

      Hi Mary Ann,

      Were you able to get the plugin to work on the Watson theme by following the instructions above and just need the “Posted by Editor” additional bit? If that’s the case, then I can help you add some text for a specific category relatively easily. However, let me know first whether you’ve gotten that far.- as the Watson theme is a paid theme, I can’t get it myself to make the changes for you.

  6. Hello,
    How can I use your very useful plugin in twenty twelve theme
    Thank you
    Marc

  7. Hi there Dirk

    I’ve successfully installed your great plug in, and have the nice little checkbox in my category page. Like others, I’m stuck with where to put the code to make it do the deed! I’m using startup-wp, which is a free theme, and I’ve gone through a few of the files (functions.php, entry-meta.php, entry,php and the template I’ve created to aggregate the posts categorised as ‘portfolio’) but haven’t been able to find the right fix. Could you help?
    Thanks so much!

  8. Hi, I use Imbalance 2 template: http://wpshower.com/themes/imbalance-2/
    I want to install your awesome plugin but does not work.
    Can you please tell what I need to add to the code?

  9. I’m working with a Web site that has a custom theme and I can’t get Category Post Info Control to work.
    And I’m not fluent in code.
    Can you suggest a solution?

  10. Hi,
    unfortunately the image with your sample code is not visible (any more?); could you please post the code lines inbetween your new codes needs to be added in the twenty-eleven theme?

    Thanks, Jens

Trackbacks

  1. [...] This was originally developed for Studiopress themes (Genesis) and for Genesis child themes you simply have to activate the plugin and it will work. To make it work on non-Genesis themes, please follow these instructions to update your theme – hide WordPress author and date on non-Genesis themes. [...]

Speak Your Mind

*

CommentLuv badge