How do I correct this filecount?

You’re right – this is very much a generic PHP question. But fwiw, the issue is that you clearly want to count all JPEG files, but your sample code counts all files – so… while ( false !== $f = $d->read() ) { if ( in_array( strtolower( pathinfo( $f, PATHINFO_EXTENSION ) ), [ ‘jpg’, ‘jpeg’ … Read more

My function echos only “array”

You shouldn’t return childpages, you should add variable $ret=””; and in each cycle append foreach(…){ $ret.=”<div…”; } and return it In general you should always return a string(or number) in such functions

index.php navigation

I think you should use wp_link_pages function, it’s was built for that purpose. $defaults = array( ‘before’ => ‘<p>’ . __( ‘Pages:’ ), ‘after’ => ‘</p>’, ‘link_before’ => ”, ‘link_after’ => ”, ‘next_or_number’ => ‘number’, ‘separator’ => ‘ ‘, ‘nextpagelink’ => __( ‘Next page’ ), ‘previouspagelink’ => __( ‘Previous page’ ), ‘pagelink’ => ‘%’, ‘echo’ … Read more

Search results template listing all posts

I figured it out with some research See the updated args $s = isset( $_GET[“s”] ) ? $_GET[“s”] : “”; $args = array( ‘s’ => $s, ‘post_type’=>array(‘page’), ‘posts_per_page’ => 6 ); query_posts($args); if ( have_posts() ) : while ( have_posts() ) : the_post();

How to display recently modified posts on recent post widget in wordpress

It’s possible to modify the ordering of the Recent Posts widgets through the widget_posts_args filter that accepts WP_Query arguments. One could order by the post_modified or the post_modified_gmt column. It might also be possible to use the widget_title filter to target a specific instance or widget title.

Custom Thumbnails [closed]

Well i fixed it. But thank you all anyway. <div class=”row”> <h4>Noticias Recentes</h4> <?php // theloop if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php// Define our WP Query Parameters ?> <?php $the_query = new WP_Query( ‘posts_per_page=3’ ); ?> <?php// Start our WP Query ?> <?php while ($the_query -> have_posts()) : … Read more

Unable to get Post Category Name and URL

To understand why get_the_category(); didn’t work we have to take a closer look at the Codex page for that function. More specifically, what that function returns. (array) Array of WP_Term objects, one for each category assigned to the post. You tried to print an Array to HTML, which is why it didn’t work. Instead, take … Read more