Tittle of post instead of tittle of page in php

To display post title, you could use: <a href=”https://wordpress.stackexchange.com/questions/310842/<?php the_permalink(); ?>” title=”<?php the_title_attribute(); ?>”><?php the_title(); ?></a> or alternately, a simple: <?php echo get_the_title(post->$ID); ?>

how to loop through blog posts in php

$args = array( ‘posts_per_page’ => -1, ‘post_type’ => ‘post’, ); $the_query = new WP_Query( $args ); If you set the posts_per_page to -1 it will return all posts. Then you can loop through and do what you want with the single post. while ( $the_query->have_posts() ) { echo get_the_author_meta( );//I have NOT used this so … Read more

Header location [closed]

HTML code: <h4 id=”yourId”><span><strong>100%</strong></span></h4> CSS: code #yourId { position: top: 10px; right: 10px; position: absolute; } If you need it to stay always there even if you’re scrolling then use this one #yourId { position: top: 10px; right: 10px; position: fixed; }

metabox displaying on incorrect page

Dropping the code quickly into my test set up, I think you are asking why your page metabox is showing your desired post meta inputs. There’s no problem with your add_meta_box() functions. The problem is with your variable $custom_meta_fields. By the time WordPress gets to the end of your file $custom_meta_fields is defined by the … Read more

How to implement a custom sliding banner? [closed]

There are a lot of slider pluglins in wordpress repository such http://wordpress.org/plugins/slide-show-pro/, just follow the install steps. then use the shortcodes like [slideshowpro cats=2,3] or the code to integrate into php php echo do_shortcode(‘[slideshowpro cats=2,3]’); insert the code in header.php to show the slider on every single page or post