• Resolved nycplugged

    (@nycplugged)


    Hello,

    Is there a plugin or code I can use to do this? I want a certain post to be highlighted at the top of my page, below the header but before the posts. The featured image as a banner image and text below with a link to the actual page.

    • This topic was modified 8 years, 6 months ago by nycplugged.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi there,
    open header.php and paste this

    <?php
    
    $args = array(
    'post_type'      => 'post',
    'p'        => 233,
    'posts_per_page' => 1
    );
    
    // The Query
    $the_query = new WP_Query( $args );
    
    // The Loop
    while ( $the_query->have_posts() ) : $the_query->the_post();
    ?>
    <div class="row top-article">
    <?php if ( has_post_thumbnail() && ! $hide_featured_image ) : ?>
    			
    				<div class="entry-featured">
    					<a href="<?php the_permalink(); ?>">
    						<?php the_post_thumbnail( $masonry ? 'ci_masonry' : 'post-thumbnail' ); ?>
    					</a>
    				</div>
    			
    		<?php endif; ?>
    	<h2 class="entry-title">
    		<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
    	</h2>
    <?php endwhile; ?>
    </div>		
    <?php   
    // Reset Post Data
    wp_reset_postdata();
    ?>

    after
    <div id="site-content">

    Replace in
    'p' => 233,
    the 233 to you post ID.

    Finally use this inside your custom css box

    .top-article{
    border:2px solid red;
    }
    

    inside your custom css box to highlight it

    This will appear everywhere though.

    Thread Starter nycplugged

    (@nycplugged)

    ehhh..is there a plugin that can do this…I found one ..but its only in the sidebar.

    Thanks!

    Hi there, then you can create a new widget are like described here https://www.cssigniter.com/docs/article/how-do-i-add-a-new-sidebar-widgetized-area/. In olsen light you will add this code un functions.php and then open your header.php and paste after

    
    <div id="site-content">

    this

    <?php dynamic_sidebar('your-sidebar-id'); ?>

    Now you can add your plugin widget to your new header widget area

    Thread Starter nycplugged

    (@nycplugged)

    Too complicated for me..I had a child theme added for me. Only know how to to make changes to stylec css. Will just use the plugin as a sidebar.

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Feature page at top of home page’ is closed to new replies.