How to use str_replace() outside the loop?

Filters don’t really affect resulting markup. More precisely they affect anything that is passed through them, in this specific case output of the_content() function is passed through the_content filter and you are able to modify it. If markup you want to change is not generated by function and not passed through filter then most likely … Read more

Post content not showing

Your query is structured a little weird. $my_query = new WP_Query( array( ‘posts_per_page’ => 5 ) ); if ( $my_query->have_posts() ) { while ( $my_query->have_posts() ) { $the_query->the_post(); // Your desired template code } // Close while() // Restore original Post Data wp_reset_postdata(); } // Close if() This should be all you need to set … Read more

the_content() “crashes” for single pages

the_content( ); vs get_the_content(); The different is pretty simple actually. If you find yourself annoyed with formatting of the content, more specifically the added p-tags that WordPress puts into the content that you didn’t. Just use get_the_content(); and you will remove those tags. Normally the get_the_content() tag returns the content WITHOUT formatting. Only the_content() will … Read more

After the local installation of an old WP website I can see the homepage but I can’t access to the articles, why?

Depending on if permalinks worked on your local server before the import or not you ether need to update the .htaccess in your wordpress root, or you need to enable rewrites all together in Apache. What operation system do you use? This is a good guide if you use linus: https://www.digitalocean.com/community/articles/how-to-set-up-mod_rewrite

TwentyThirteen – Footer overlapping content [closed]

This is because your footer is fixed which removes it from the normal page flow. You can add 50px padding-bottom to your #main div (or .site-main on line 790 of your style.css). Overall this though isn’t really a WordPress questions and more of a HTML / CSS Questions. Please visit Stack Overflow.

Trying to get this function to show below the content

If it was me I’d not echo the text I’d make it a variable e.g. $additional_text = “” then at the end of the function return $additional_text;. if (have_posts()) : while (have_posts()) : the_post(); $additional_text=”<div class=”timeline”>”; $additional_text .= ‘<a href=”‘; $additional_text .= the_permalink(); $additional_text .= ‘”><h3>’; $additional_text .= the_title(); $additional_text .= ‘</h3></a>’; $additional_text .= ‘</div>’; … Read more