Hey Folks!

During April & May of 2020, answers may be delayed more than it usually happens. This is caused by my personal situation that requires a lot of time from me to be dedicated elsewhere, and also because of the local things that are happening currently cause of the all things connected to "Corona Virus".

Please be patient, all answers are coming as soon as possible :-)

Sorry for any inconvenience.

Air.
Before you ask please READ THIS

Page password for one special category

edited May 2013 in Hypershot Posts: 40
Hi Air,

first of all: My page looks amazing now!! Thanks for your theme AND help!!

There is only one thing missing for the relaunch :)
My question/feature request:

On my old page I had a category, which was only readable for friends etc. I had a protection for the whole subpage based on archive/blog templates.
The rest of the blog was open for all (and the protected posts were not shown - we had this topic before and this is solved! Thanks!)

the code was like this:
<?php get_header(); ?>
<?php if(post_password_required()){ echo '<div class="password-protected-page">'.get_the_password_form().''; }else{ ?>
everything that should be hidden
<?php } ?>
<?php get_footer(); ?>
How could I manage this with your theme?
I tried to use a copy of the archive template... but it didn't work out well :)
There are several plugins which do stuff - but not the way I need it.

To put it in one sentence:
It would be great, if I had the option to have the standard blog AND the password protected archive/blog page, which only shows posts of the private category (even a simple link for the menu would be fine!)

Is this some how possible?
Thanks for reading so much text!! :)

All the best
Max
Post edited by macmacs on

Comments

  • AirAir
    Posts: 10,338
    macmacs said: Thanks for reading so much text!! :)
    I have to read longer ones, unfortunately ;-)

    About your request it is not easy. You can add, every password protected post to certain category, and then link it in menu(it is possible in any theme), but it will make this posts also visible on main blog page(but with required password).

    You can try to hide this category on main blog page with some plugin.

    I know it is all probably obvious what I wrote here, but maybe it is somehow helpful.

    With regards.


  • Posts: 40
    Well, You were right :) It is a lot of work.

    But no matter what, I figured, for it is MY wish, I should work it out by myself :D
    So, I found a way. Basicly copying some templates (frontpage,loop,...) and adjusting them to my needs.

    If anyone was interested in this customization, I'd write it down.

    Regards,
    Max
  • AirAir
    Posts: 10,338
    Pretty nice!
    If you like you can zip your result file and attach it here, but only if you like:-)

    Have a nice day!
  • Posts: 40
    Ok, no problem. I am going to do that once I finished things like adjusting the info bar :)
  • Posts: 40
    Hi guys,
    I collected my files and give them to you:

    1. Put the three php files in the main theme folder (../themes/hypershot/).
    2. Alter the filtered category (here 'protected') in the protected-loop.php to your prefered category name:
    $args = array(
    'posts_per_page' => 10,
    'paged' => $paged,
    'category_name' => 'protected'
    );
    3. create a page based on the protected template and password protect the page.
    4. Exclude the protected category from the main blog (and feed) via the 'Ultimate Category Excluder' plugin

    Now, in there should only be posts with the choosen category in the protected blog!

    Have fun ;)
    Regards
    Max
    zip
    zip
    protected.zip
    3K
  • AirAir
    Posts: 10,338
    Thanks for sharing this one, looks pretty nice:-)

    With kind regards.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion