• wmmead

    (@wmmead)


    Hi, I am building a custom theme for a magazine style site. The front page has multiple loops that are working great. One of the loops displays posts in a commentary category.

    The client wants to be able to not display the part of the page displaying the commentary when he feels that the content he has for that block is too old. There is a commentary section of the site when viewers can go read older commentary posts (simply a category page).

    Does anyone know of a plugin that does this kind of thing? I am not even sure what to search for.

Viewing 7 replies - 1 through 7 (of 7 total)
  • David Gard

    (@duck_boy)

    You’d probably be best adding a simple options page to the admin area with a 1 option – ‘Display Ccommentary’, with a checkbox as the input type.

    Then, in the source, wrap the code that display the Commentary as below

    <?php if(get_option('display_commentary')){ ?>
        [Your code goes here...]
    <?php } ?>

    If you are unsure on how to create an options page then let me know and I can point out some excellent tools to help you. Once you have got your head around this you will be able to open all sorts of doors for users, with regards to controlling the site via the back end.

    Thread Starter wmmead

    (@wmmead)

    Thanks, this is exactly the direction I was thinking of going. Was just looking into how to write a plugin, which I have not done yet, in order to get an option page you suggest.

    Please do post the resources you mention. That would be really helpful. Or if you have any example code, that would be great. I am pretty good (but not an expert) with PHP. This is a hurdle I definitely need to get over and have been putting off.

    Let me know if you want to get in contact off forum.

    -Bill

    David Gard

    (@duck_boy)

    Right, firstly – sorry for the delay in getting back to you.

    Next up, I have been working on a tutorial for writing plugins lately, so I figured this was a good time to test it. I acutally worked through it using your situation, so I’ve ended up with a working plugin that should suit you, if you are willing to give it a good home? It has loads of notations that I hope make sense, and will hopefully allow you to expand it and create your own in the future.

    It’s about 300 lines, and I don’t have a website to put it on yet, so do you have any email address that you are able to give me, and I can send it to you?

    Thanks.

    Thread Starter wmmead

    (@wmmead)

    Very cool. I can post it for you if you like. Go ahead and send it to me at [email protected]

    David Gard

    (@duck_boy)

    Email sent with file attached. Let me know if you get any issus, and for srcurity, I’d take your email down now (If it’ll still let you!!)

    Thanks.

    Thread Starter wmmead

    (@wmmead)

    Hmm, I didn’t get the email. Can you send again? Thanks!

    David Gard

    (@duck_boy)

    Was in my sent items, but resent any way. Maybe it went in to your spam folder? It’s coming from a hotmail address.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Turn off content bock’ is closed to new replies.