skim-
Forum Replies Created
-
Forum: Hacks
In reply to: Hook suggestion?I would use a cron job, if at all possible.
http://codex.ww.wp.xz.cn/Function_Reference/wp_schedule_event
A simple way to accomplish this without a new WP Query :
https://codex.ww.wp.xz.cn/Function_Reference/get_post_format
Here I’ve modified two of your lines of code. Note that get_post_format returns false if Standard ( i.e. no ) post format is set.
<?php if ( have_posts() ): while ( have_posts() ): the_post(); if( !get_post_format() ) : ?> // do all of your display <?php endif; endwhile; ?>Forum: Hacks
In reply to: Extending the Insert Media Dialog for a Custom File TypeExtending the media upload dialog : http://codex.ww.wp.xz.cn/Plugin_API/Filter_Reference/attachment_fields_to_edit
Changing HTML that gets added to post for an attachment : I would look into using http://codex.ww.wp.xz.cn/Plugin_API/Filter_Reference/prepend_attachment and the better explanation at http://wpseek.com/prepend_attachment/
Forum: Hacks
In reply to: Custom WP query on multiple meta_keys and meta_valuesFrom the codex ( using built-in functions ), modified to your needs I think.
$args = array( 'post_type' => 'post', 'meta_query' => array( array( 'key' => 'mb_category', 'value' => 'To Let', 'compare' => '=' ), array( 'key' => 'mb_property-type', 'value' => 'id119', 'compare' => '=' ) ) ); $query = new WP_Query( $args );Why do this with plain SQL?
Forum: Fixing WordPress
In reply to: drop menu behind sliderThe only difference I can see between your theme and the one on display at ThemeForest is the version of jQuery. It wouldn’t hurt to switch to 1.4.3 to see if that makes a difference ( or update to the latest version of Nivo Slider ).
Forum: Fixing WordPress
In reply to: drop menu behind sliderMaybe a bigger problem – the sub-menu does not actually appear at all on the homepage when hovering over the initial item. It does appear on subsequent pages. JS conflict?
Forum: Fixing WordPress
In reply to: Loop Issue ForeachYou can hack this with an html width attribute on the image
<?php $slides = $data['pingu_slider']; //get the slides array foreach ($slides as $slide) { echo '<li> <a href="'. $slide['link']. ' "> <img src="' . $slide['url' ] . '" width="400" /> </a> <div class="flex-title">'. $slide['title']. ' </div> <div class="flex-caption">'. $slide['description']. ' </div> </li>'; } ?>Or your second code block can be edited like this ( if ‘pingu_slider’ is a post type ). Also have a look at http://codex.ww.wp.xz.cn/Class_Reference/WP_Query for how to structure arguments for WP_Query.
<ul class="slides"> <?php $loop = new WP_Query( array( 'post_type' => 'pingu_slider' ) ); ?> <?php while ( $loop->have_posts() ) : $loop->the_post(); ?> <li> <?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'small-thumb' ); } ?> </li> </ul>