Retrieve First Image Function

Hmm that looks familiar 😉 You are missing the orderby parameter, in this case you want to order by menu_order. Also there is no reason to query all the data using -1 when you just want one image returned so instead use 1. $attachments = get_children( array( ‘numberposts’ => 1, ‘order’=> ‘ASC’, ‘post_mime_type’ => ‘image’, … Read more

Why a SlideShow (made using JQuery FlexSlider) can’t work if I load it form functions.php but work if I load it from my footer.php file? [closed]

As @Milo said , WP loads jQuery in no conflict mode so shortcut $ is not available for jQuery to use .You should not use the $ variable for jQuery within WordPress.As you said you are not into jQuery i’m just giving the code below..Try it. jQuery(function ($) { $(window).load(function() { $(‘#main-slider’).flexslider({ animation: “slide”, useCSS: … Read more

Expected ‘add_filter’ (T_STRING)

You are dealing with a class. Most everything has to be inside a class method, not counting class variables/constants. Second, you the syntax is slightly different when adding a class method, rather than a function, to a hook. function widget( $args, $instance ) { add_filter(‘get_avatar’, array($this,’remove_photo_class’)); // the rest of your code } I would … Read more

search form leads to 404

Don’t submit directly to search.php. WordPress probably will not know what to do with that. You will have the same issue submitting directly to any theme file. WordPress should pick up on the s parameter and process the search correctly if you just leave out the action attribute like so: <form id=’searchform’ method=’get’> Untested, but … Read more