Home Forums Plugin Support WP User Frontend Pro Post templates

This topic is: not resolved

Tagged: 

This topic contains 6 replies, has 2 voices, and was last updated by  Nicolas 4 years, 12 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #19230

    Nicolas
    Member
    Post count: 10

    I want to define a post template to new form posts and I don't see the option.
    Is there any way to do it?
    Thanks

    #19235

    Oritro Ahmed
    Spectator
    Post count: 155

    Hi Nicolas,

    Its Quite easy. Whenever you are Building or Editing a From, You will find a Post Settings Tab there. Go there, and You will find a Select box for Post Type. You Can define your desired post type.

    For A Better Understanding, Here is a Screenshot,

    Enlarged View

    #19239

    Nicolas
    Member
    Post count: 10

    That's about post types but not post templates.
    I've a single.php and a single2.php (with small diferences in author bx) formats and that's what I want to define.
    I would like to know if the post format can be changed, because I only have -NONE- option and meybe it can be my solution.

    #19240

    Oritro Ahmed
    Spectator
    Post count: 155

    My point was, You can Assign a Specific Post Type to a Specific Template, Then you can call it from here !

    #19242

    Nicolas
    Member
    Post count: 10

    But I dont want users to post custom types, because of the architecture of my site, I prefer to use template posts.
    That's because if I do post types, when I go to a users posts I will see 0 results of posts.

    #19244

    Oritro Ahmed
    Spectator
    Post count: 155

    Well Nicolas, There is only one Legitimate Way to Solve this problem.

    Create a Hidden Field on the form, Specify a Fixed value for that. Now while viewing the post, fetch that value and use it to determine the Template. Like a Conditional template.

    Hopefully that will help you.

    #19246

    Nicolas
    Member
    Post count: 10

    Sorry but i don't understand it.
    What I'm trying now is a total diferent way to get what i want.
    I want to show author box only for non admin users (or some roles) and that's why I was doing a post template only for authors with author box.

    Now I'm tring to get a php code to show author box only if the post author role is Author.
    Maybe you can help me, i'm trying this code but i cant get to work

    <?php 
    global $wp_query;
    $roles = $wp_query->queried_object->roles;
    if( $roles[0] == 'author' ) {?>
    
     <h4 class="author_box_title"><?php _e('About The Author', 'theme'); ?></h4><?php
    echo do_shortcode('[upme id=author]');
    ?>
        <?php } ?><?php }?>

    Thanks

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Post templates’ is closed to new replies.