How to display recent posts on home page with custom HTML

<div id=”posts”> <?php // define query arguments $args = array( ‘posts_per_page’ => 8, // your ‘x’ goes here ‘nopaging’ = true // possibly more arguments here ); // set up new query $tyler_query = new WP_Query( $args ); // loop through found posts while ( $tyler_query->have_posts() ) : $tyler_query->the_post(); echo ‘<section class=”post”>’. ‘<h2><a href=”‘. get_permalink(). … Read more

Custom /page/2/ template (different from index.php)

I would use the is_paged() conditional inside index.php to load two separate templates containing your layouts. Something like this: if ( is_paged() ): get_template_part( ‘content’, ‘first-page’ ); else: get_template_part( ‘content’, ‘paged’ ); endif; Assuming you have two templates, content-first-page.php and content-paged.php. Edit: If you just want a different template for part of your index page, … Read more

How to display thumbnail and excerpt of a page on homepage?

<?php $post_id = 50; // assign post id $queried_post = get_page($post_id); if(is_home()) { ?> <div class=”product_title”><h3><a href=”https://wordpress.stackexchange.com/questions/72514/<?php echo get_page_link($post_id); ?>”><?php echo $queried_post->post_title; ?></a></h3></div> <div class=”product_image_location”><?php echo get_the_post_thumbnail( $post_id); ?></div> <div class=”description_product”> <?php echo $queried_post->post_content; ?></div> <?php } ?>

How to insert an Audio Player in a Post or Page?

Plugin option When searching for a plugin, it is important to check: Compatible up to, supports current WordPress version? Last updated, too long ago? Support, too many bug reports? Level of support in the forum or in the official plugin page. Compatibility, if the plugin hasn’t been updated for a while or is not compatible … Read more

is_home() in HTML head

both is_home() and is_front_page() works in the header or anywhwere you are using a theme template. Most likely, the problem is because you’ve hardcoded this: /wordpress/wp-content/themes/roots/style.php Try instead creating your url like this: <link rel=”stylesheet” type=”text/css” media=”all” href=”https://wordpress.stackexchange.com/questions/85053/<?php echo get_stylesheet_directory_uri(); ?>/style.php?tcount=<?php echo $count;?>” />

Toolbar/topbar missing on homepage only?

As Mayeenul wrote: Use Firebug/Chrome Inspector to see what’s wrong. Look for Javascript Errors in the console see if the Adminbar is inside the DOM but hidden via CSS. It could also be disabled via a filter in PHP with something like this: if( is_front_page() ) { add_filter(‘show_admin_bar’, ‘__return_false’); } … but I would say … Read more