WordPress.org

Ready to get started?Download WordPress

Forums

Oxygen
[resolved] Remove featured photo on post page ? (10 posts)

  1. thebalticfrench
    Member
    Posted 1 year ago #

    Hello :)

    I am a new wordpress user and I start bloging with it instead of Blogger partialy because of this theme!

    Fantastic job.

    I have first tried it on wordpress.com, was working nice.

    But now, hosting on my own I have notice something annoying for me.

    On each post I make is the featured image over the title, I don't want it. I have look on some forum how to remove it, find part of code and made the manipulation, nothing happened..

    So I hope some of you can help me to know where I am wrong.

    I have remove this lines in the code of index.php located in the oxygen theme folder. (lines 42-44)

    <?php if ( current_theme_supports( 'get-the-image' ) ) {
    
      get_the_image( array( 'meta_key' => 'Thumbnail', 'size' => 'archive-thumbnail', 'image_class' => 'featured', 'width' => 470, 'height' => 140, 'default_image' => get_template_directory_uri() . '/images/archive-thumbnail-placeholder.gif' ) );							
    
    } ?>

    Is something else to do or what ? :)

  2. thebalticfrench
    Member
    Posted 1 year ago #

    Here is the code of index.php located in /themes/oxygen/

    <?php
    /**
     * Index Template
     *
     * This is the default template.  It is used when a more specific template can't be found to display
     * posts.  It is unlikely that this template will ever be used, but there may be rare cases.
     *
     * @package Oxygen
     * @subpackage Template
     */
    
    get_header(); // Loads the header.php template. ?>
    
    	<div class="aside">
    
    		<?php get_template_part( 'menu', 'secondary' ); // Loads the menu-secondary.php template.  ?>
    
    		<?php get_sidebar( 'primary' ); // Loads the sidebar-primary.php template. ?>
    
    	</div>
    
    	<?php do_atomic( 'before_content' ); // oxygen_before_content ?>
    
    	<div class="content-wrap">
    
    		<div id="content">
    
    			<?php do_atomic( 'open_content' ); // oxygen_open_content ?>
    
    			<div class="hfeed">
    
    				<?php if ( have_posts() ) : ?>
    
    					<?php while ( have_posts() ) : the_post(); ?>
    
    						<?php do_atomic( 'before_entry' ); // oxygen_before_entry ?>
    
    							<div id="post-<?php the_ID(); ?>" class="<?php hybrid_entry_class(); ?>">		
    
    							<?php do_atomic( 'open_entry' ); // oxygen_open_entry ?>
    
    							<div class="entry-header">
    
    								<?php echo apply_atomic_shortcode( 'entry_title', '[entry-title]' ); ?>
    
    								<?php echo apply_atomic_shortcode( 'byline_date', '<div class="byline byline-date">' . __( '[entry-published]', 'oxygen' ) . '</div>' ); ?>
    
    								<?php echo apply_atomic_shortcode( 'byline_author', '<div class="byline byline-author">' . __( 'by [entry-author]', 'oxygen' ) . '</div>' ); ?>
    
    								<?php echo apply_atomic_shortcode( 'byline_edit', '<div class="byline byline-edit">' . __( '[entry-edit-link]', 'oxygen' ) . '</div>' ); ?>
    
    							</div>
    
    							<?php echo apply_atomic_shortcode( 'byline_category', '<div class="byline byline-cat">' . __( '[entry-terms taxonomy="category" before=""]', 'oxygen' ) . '</div>' ); ?>
    
    							<div class="entry-summary">
    
    								<?php the_excerpt(); ?>
    
    								<?php wp_link_pages( array( 'before' => '<p class="page-links">' . __( 'Pages:', 'oxygen' ), 'after' => '</p>' ) ); ?>
    
    							</div>
    
    							<a class="read-more" href="<?php the_permalink(); ?>"><?php _e( 'Read Article', 'oxygen' ); ?> &rarr;</a>
    
    							<?php do_atomic( 'close_entry' ); // oxygen_close_entry ?>
    
    						</div><!-- .hentry -->
    
    						<?php do_atomic( 'after_entry' ); // oxygen_after_entry ?>
    
    					<?php endwhile; ?>
    
    				<?php else : ?>
    
    					<?php get_template_part( 'loop-error' ); // Loads the loop-error.php template. ?>
    
    				<?php endif; ?>
    
    			</div><!-- .hfeed -->
    
    			<?php do_atomic( 'close_content' ); // oxygen_close_content ?>
    
    			<?php get_template_part( 'loop-nav' ); // Loads the loop-nav.php template. ?>
    
    		</div><!-- #content -->
    
    		<?php do_atomic( 'after_content' ); // oxygen_after_content ?>
    
    <?php get_footer(); // Loads the footer.php template. ?>
  3. gupekTop
    Member
    Posted 1 year ago #

    Hello, thebalticfrench!

    Try this, worked for me.

    Find post.php in Oxygen folder, search <div class="post-content"> and comment under this title first php code.

    Today I worked on my site and have the same problem. When I choose a thumbnail, I have a picture of it over the first title. And, of course, I have this picture in the post too.

    If you will have such problem in future, or if you want understand what I do, try this steps:
    1)Open your post in browser, I used firefox. Highlight the picture over title, just like you highlight text in Word.
    2)Press right mouse button and choose "highlighted fragment code".
    3)You will see html code of highlighted fragment. Find above "<div class="post-content">.
    4)Search *.php files in your Oxygen folder for title "<div class="post-content">. I found it in post.php

  4. thebalticfrench
    Member
    Posted 1 year ago #

    Oh great !

    I used to find slution by myself withing the developper module of Chrome, but I haven't realized that the page would be post.php :)

    Anyway, thanks a lot, now the theme is perfect! :)

  5. thebalticfrench
    Member
    Posted 1 year ago #

    Solved!

  6. Jana
    Member
    Posted 1 year ago #

    What are you supposed to do with "<div clas="post-content"> once you find it? I don't understand what "comment under this title first php code" means.
    Thanks.

  7. thebalticfrench
    Member
    Posted 1 year ago #

    It means that on the post.php is a part of code

    <div class="post-content">

    which supose to be your text. The previous lines are those which call the featured, and then those that you should delete.

    Those lines :

    <?php if ( current_theme_supports( 'get-the-image' ) ) {
    
      get_the_image( array( 'meta_key' => 'Thumbnail', 'size' => 'archive-thumbnail', 'image_class' => 'featured', 'width' => 470, 'height' => 140, 'default_image' => get_template_directory_uri() . '/images/archive-thumbnail-placeholder.gif' ) );							
    
    } ?>
  8. Darasy
    Member
    Posted 1 year ago #

    Im having the same issue.... can you tell me where in wordpress do I go to find the folder this code is in. any help would be appreciated. Thanks

  9. gadgetmilk
    Member
    Posted 1 year ago #

    look for the file post.php then look for this code:

    <?php if ( current_theme_supports( 'get-the-image' ) ) get_the_image( array( 'meta_key' => 'Thumbnail', 'size' => 'single-thumbnail', 'link_to_post' => false, 'image_class' => 'featured', 'attachment' => false, 'width' => 470, 'height' => 260 ) ); ?>

    simply delete that part and save. the featured image on the posts will disappear but the featured posts on archives will still be there. it's what i did with my site

  10. simply delete that part and save.

    Don't edit the theme's file like that, you'll just lose your work when the theme is updated. Try creating a child theme instead and make your changes there. It's safer that way.

    http://codex.wordpress.org/Child_Themes

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic