WordPress.org

Ready to get started?Download WordPress

Forums

DevDmBootstrap3
[resolved] How to move time and author from post meta (7 posts)

  1. Gabbz
    Member
    Posted 4 months ago #

    Hi,
    first I just have to thank you for an awesome theme. Really nice to work with.

    Now I'm a little newbie here, and could use some help or just a nudge in the right direction. I want to move the time and author to above the post, just below the header line. Instead of having it together with the category and tags.

  2. DevDm
    Member
    Theme Author

    Posted 4 months ago #

    Glad you like the theme Gabbz! What you are trying to do can be accomplished with a couple little adjustments to your child theme.

    The first thing you will want to do is duplicate the template-part-postmeta.php file and put a copy of it in your child theme. This contains the current code for the post time and author. You'll want to remove it from the file so it doesn't show twice. This will give you some code to copy and paste into the next file you are going to duplicate.

    That file is the main index.php file. This contains the main loop that is running through your posts and where you will put in the code you just cut out!

    You will see two <h2 class="page-header"> lines in this index.php file. This is where the title code starts for a single post (the top loop) and multiple posts (the bottom loop). So around this area you will put in your code you cut out from the template-part-postmeta.php and make any adjustments.. yadda yadda!

    Hope this helps!

  3. Gabbz
    Member
    Posted 4 months ago #

    Thanks, that worked like a charm :)

    Another question, how do I enable the boostrap navbar-static-top?
    Is it possible?

  4. DevDm
    Member
    Theme Author

    Posted 4 months ago #

    Sure is!

    You will duplicate the template-part-topnav.php

    Find this line:

    <nav class="navbar navbar-inverse" role="navigation">

    and just add the class "navbar-fixed-top"

    So it turns into:

    <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">

    Now, when you are logged in the admin bar hovers over it so you will need to put in some logic there to add some margin/padding to the nav and the body if it bothers you. There are a few ways to do that.

    You can use the function below to test and sort it out.

    http://codex.wordpress.org/Function_Reference/is_admin_bar_showing

  5. Gabbz
    Member
    Posted 4 months ago #

    Yea I got the fixed to top working, but I rather have it scroll with the content therefore I need the static one :)

  6. DevDm
    Member
    Theme Author

    Posted 4 months ago #

    Oh in that case it is easier.

    Add the "navbar-static-top" to the <nav > element.

    Open that index.php file and switch the position of these two:

    <?php get_template_part('template-part', 'head'); ?>

    <?php get_template_part('template-part', 'topnav'); ?>

    So the topnav will be first.

    <?php get_template_part('template-part', 'topnav'); ?>

    <?php get_template_part('template-part', 'head'); ?>

    You'll need to do this for page.php too!

  7. Gabbz
    Member
    Posted 4 months ago #

    Thanks for your help :)

Reply

You must log in to post.

About this Theme

About this Topic

Tags