WordPress.org

Forums

[Theme: Bromine] How to change position of featured image ? (2 posts)

  1. OlgKama
    Member
    Posted 1 year ago #

    Hello everybody,
    I have a problem, when I post in my blog the featured image of post is on the top of title, I want that this image will be on the right side, text on the left side and the title on the top of the post.
    How I understand it's written in content.php file ... But i don't understand how to change it.

    content.php:

    <?php
    /**
     * The default template for displaying content
     *
     * @package Bromine
     * @since Bromine 1.0.0
     */
    ?>
    <article id="post-<?php the_ID(); ?>" <?php post_class('bro-cf'); ?>>
        <header class="post-header">
            <div class="header-metas">
    
                <?php bro_post_format(); ?>
    
                <?php if( is_singular() ) { edit_post_link( __( 'Edit', 'bromine' ), '<span class="edit-link">', '</span>' ); } ?>
    
                <span class="post-date">
                    <time class="published" datetime="<?php echo get_the_time('c'); ?>"><a title="<?php _e( 'Permalink to: ', 'bromine' ); echo the_title(); ?>" href="<?php the_permalink(); ?>"><?php echo get_the_date(); ?></a></time>
                </span>
    
            </div>
    
            <?php
                bro_display_thumbnails();
                if ( is_single() ) :
                    the_title( '<h1 class="post-title">', '</h1>' );
                else:
                    the_title( '<h1 class="post-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );
                endif;
            ?>
    
        </header>
    
        <div class="post-content">
    
            <?php if( is_singular() ) :
    
                the_content();
                bro_content_nav();
    
                else:
    
                the_excerpt(); ?>
                <a class="read-more" href="<?php the_permalink(); ?>" title="<?php echo _e( 'Read more', 'bromine' ); ?>"><i class="g"></i><?php echo _e( 'Read more', 'bromine' ); ?></a>
    
            <?php endif; ?>
    
        </div>
    
        <?php if( is_single() ) : ?>
        <footer class="post-footer">
            <ul class="taxo-metas">
                <?php if( get_the_category() ) { ?><li class="category"><i class="gicn gicn-category"></i><?php the_category(' • '); ?></li><?php } ?>
    
                <li class="tag-links"><i class="gicn gicn-tag"></i><?php
                    $tags_list = get_the_tag_list( '', __( ' ', 'bromine' ) );
                    if ( $tags_list ) :
                        printf( __( '%1$s', 'bromine' ), $tags_list );
                    else :
                        _e( 'No tags', 'bromine' );
                    endif; ?>
                </li>
            </ul>
        </footer>
        <?php endif; ?>
    
    </article>

    content-gallery.php

    <?php
    /**
     * Gallery posts
     *
     * @package Bromine
     * @since Bromine 1.0.0
     */
    ?>
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
        <header class="post-header">
            <div class="header-metas">
    
                <?php bro_post_format(); ?>
    
                <?php if( is_singular() ) { edit_post_link( __( 'Edit', 'bromine' ), '<span class="edit-link">', '</span>' ); } ?>
    
                <span class="post-date">
                    <time class="published" datetime="<?php echo get_the_time('c'); ?>"><a title="<?php _e( 'Permalink to: ', 'bromine' ); echo the_title(); ?>" href="<?php the_permalink(); ?>"><?php echo get_the_date(); ?></a></time>
                </span>
    
            </div>
    
            <?php
                bro_display_thumbnails();
                if ( is_single() ) :
                    the_title( '<h1 class="post-title">', '</h1>' );
                else:
                    the_title( '<h1 class="post-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );
                endif;
            ?>
    
        </header>
    
        <div class="post-content">
    
            <?php if( is_single() ) :
    
                the_content();
                bro_content_nav();
    
                else:
    
                the_excerpt(); ?>
                <a class="read-more" href="<?php the_permalink(); ?>" title="<?php echo _e( 'Read more', 'antimony' ); ?>"><?php echo _e( 'Read more', 'antimony' ); ?></a>
    
            <?php endif; ?>
    
        </div>
    
        <?php if( is_single() ) : ?>
        <footer class="post-footer">
            <ul class="taxo-metas">
                <?php if( get_the_category() ) { ?><li class="category"><i class="gicn gicn-category"></i><?php the_category(' • '); ?></li><?php } ?>
    
                <li class="tag-links"><i class="gicn gicn-tag"></i><?php
                    $tags_list = get_the_tag_list( '', __( ' ', 'bromine' ) );
                    if ( $tags_list ) :
                        printf( __( '%1$s', 'bromine' ), $tags_list );
                    else :
                        _e( 'No tags', 'bromine' );
                    endif; ?>
                </li>
            </ul>
        </footer>
        <?php endif; ?>
    
    </article>
  2. Manoz69
    Inactive
    Posted 1 year ago #

    Hello OlgKama,

    I'm the developer of "Bromine. Sorry about the answer time, I didn't see your post. The support forum for Bromine is here: http://wordpress.org/support/theme/bromine

    The featured image is included in the function bro_display_thumbnails().

    If you want your image on the right, content on the left and title on the top, you have to add some css classes/properties and modify some php code.

    Important: if you modify your theme and if I update it, you'll loose all your changes.

    Go to /inc/post-tweaks.php .
    Find <div class="bro-thumbnail"> and replace it with <div class="bro-thumbnail <?php if(is_single()){echo 'bro-right';}?>">

    In content.php and all your content-****.php files,
    Find <div class="post-content"> and replace it with <div class="post-content <?php if(is_single()){echo 'bro-left';}?>">.
    With the "if" condition, it will do the trick only on posts, not on pages.

    Find bro_display_thumbnails(); and move it under the title like so:

    <?php
        if ( is_single() ) :
            the_title( '<h1 class="post-title">', '</h1>' );
        else:
            the_title( '<h1 class="post-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );
        endif;
        bro_display_thumbnails();
    ?>

    Finally, find <footer class="post-footer"> and add <div class="clear"></div> 1 line above like so:

    <?php if( is_single() ) : ?>
    <div class="clear"></div>
    <footer class="post-footer">

    It should work but again, if you modify the code, you'll loose all your changes if I update the theme (and I'll update it very soon).

Topic Closed

This topic has been closed to new replies.

About this Topic