Bug with post titles [closed]

This is usually due to using custom query/loop stuff after the main query and not calling either wp_reset_postdata() or wp_reset_query() after you’re done. See this answer for more detail on which to use.

WordPress “Posts Page” isn’t showing template dropdown

Ben, Welcome to StackExchange! Page Templates are only able to be defined in the Page post type (“Pages” in the WP-admin). https://developer.wordpress.org/themes/template-files-section/page-template-files/#uses-for-page-templates You can edit your theme (or create a child theme) to define how your post pages are displayed. Depending on your needs you could define an archive.php, category.php or index.php in your theme … Read more

WordPress Custom Theme: My site shows the same posts on Page 1 and Page 2 and so on [duplicate]

You need to pass posts_per_page and paged param. $args = array( ‘post_type’ => ‘nutrisense_nieuws’, ‘posts_per_page’ => get_option(‘posts_per_page’); // number of posts to show per page ‘paged’ => get_query_var( ‘paged’, 1 ) // get page if set else page 1, Use “page” for static front page instead of “paged” see the links. ); $the_query = new … Read more

Automatically add class to link based on link text

If I understand it correctly you want a visual indicator for departures relevant on the current time. One solution will be using Javascript and provide a way for the element to be identified as passed or active schedule time. HTML <div id=”myElement”> <a href=”https://myawesomenewsite.com/departuretime/1253″>1253</a> <a href=”https://myawesomenewsite.com/departuretime/1255″>1255</a> <a href=”https://myawesomenewsite.com/departuretime/0955″>0955</a> <a href=”https://myawesomenewsite.com/departuretime/2213″>2213</a> </div> JAVASCRIPT // find elements … Read more

WordPress posts [closed]

There are multiple ways to accomplish this, depending on your expertise and specific needs. First of all, you have not specified how these four posts are selected. Do you want to select them manually in the backend? Or are they the 4 most recent posts? Or random? Or from a specific category? Depending on the … Read more

custom post type single page template not working

Please see the Template Hierarchy. There is no template-portfolio.php template. It needs to be archive-portfolio.php. Also, you should not be using a custom query*. Use the main query in your post type archive templates. WordPress already queries the correct posts for you. So remove: $portfolio = new WP_Query(‘post_type’=> ‘portfolio’); And replace: while ($portfolio-> have_posts() ) … Read more

First post in loop displays twice

The else of the $change % 5 == 0 also runs when $change is a 1 and that is why the first post is displayed twice. You could fix it by changing <?php $change++ ?> <?php endif; ?> <?php if ( $change % 5 == 0 ) : ?> to <?php $change++ ?> <?php elseif … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)