Forum Replies Created
-
AuthorPosts
-
octoberstoneMember
Many thanks Christoph
I moved all the .genesis-nav-menu.responsive-menu items into 1023px media and it worked. I didn't need to change the global.js from 800 to 1023px as I thought I would. Not sure what the significance of that is. Its working anyway. Thanks again, Tony
octoberstoneMemberMany thanks for your suggestions. I tried your suggestion Braddalton but I got lost - however it did help me understand how things worked and so I was able to refine my search and found the following which worked. The short code to be placed in my page is [Tenders]
I found it here: http://wpsmith.net/2011/custom-post-types/understanding-wordpress-custom-post-types-displaying-custom-post-types/
[PHP]function wps_tenders_posting() {
global $post;
$xglobals = $GLOBALS;
$args = array( 'post_type' => 'tenders' , 'posts_per_page' => 10 , 'orderby' => 'post_title' , 'order' => 'ASC' );
$tendersloop = new WP_Query( $args );
if ( $tendersloop->have_posts() ) {
while ( $tendersloop->have_posts() ): $tendersloop->the_post();
$output .= '<div id="tenders-content">';
$output .= '<header class="entry-header"><h3 class="tender-title">'.get_the_title() .'</h3></header>';
$output .= '<p class="entry-meta">Published: <time class="entry-time" itemprop="datePublished">';
$output .= get_the_date();
$output .= '</time></p>';
$output .= '<p>' .get_the_excerpt();
$output .= '</p>';
$output .= '<div class="tender-meta">';
$output .= '- <span class="medium">Closing date: </span>' .get_field( 'closing_date' );
$output .= ' - <span class="medium">at </span>' .get_field( 'closing_time' );
$output .= '
';
$output .= '</div></div>';
endwhile;
}
else
$output = '<p>No tenders were found.</p>';
$GLOBALS = $xglobals;
return $output;
}function my_init() {
add_shortcode( 'tenders' , 'wps_tenders_posting' );
}add_action('init' , 'my_init');
[/PHP]octoberstoneMemberThanks @anotherusername I mistaking published this topic twice. Couldn't figure out how to remove. 🙂
I'm a beginner.I managed to figure out the code I required with trial and error. If anyone has a similar issue, this is what worked for me.
I would be keen to know if the code is clean and is a good solution.My custom post type is 'tenders'
I put the code below into my functions file (I actually created a function plugin)
Thanks to http://wpsmith.net/2011/custom-post-types/understanding-wordpress-custom-post-types-displaying-custom-post-types/function wps_tenders_posting() { global $post; $xglobals = $GLOBALS; $args = array( 'post_type' => 'tenders' , 'posts_per_page' => 10 , 'orderby' => 'post_title' , 'order' => 'ASC' ); $tendersloop = new WP_Query( $args ); if ( $tendersloop->have_posts() ) { while ( $tendersloop->have_posts() ): $tendersloop->the_post(); $output .= '<div id="tenders-content">'; $output .= '<header class="entry-header"><h1 class="entry-title"><a href="'.get_permalink().'" title="' . get_the_title() . '">'.get_the_title() .'</a></h1></header>'; $output .= '<p class="entry-meta">Published: <time class="entry-time" datetime="2014-11-10T10:47:44+00:00" itemprop="datePublished">'; $output .= get_the_date(); $output .= '</time></p>'; $output .= '<p>' .get_the_excerpt(); $output .= '</p>'; $output .= '<div class="tender-meta">'; $output .= '<ul><li><span class="medium">Closing date: </span>' .get_field( 'closing_date' ); $output .= '<li><span class="medium">at </span>' .get_field( 'closing_time' ); $output .= '</li></ul>'; $output .= '</div></div>'; endwhile; } else $output = '<p>No tenders were found.</p>'; $GLOBALS = $xglobals; return $output; } function my_init() { add_shortcode( 'tenders' , 'wps_tenders_posting' ); } add_action('init' , 'my_init');
octoberstoneMemberHi Brad, many thanks for this. Got it to work with a bit of tweeking. I updated to Genesis 2.0 and updated the child theme 'Agentpress' for html5.
The instructions for updating the child theme were missing a vital piece of php though, to turn on the turn on HTML5 Markup - which I found here: http://dynamiktheme.com/genesis-xhtml-to-html5-css-converter/ leading on to here: https://gist.github.com/StewartChamberlain/5637847#file-add-html-5-support-to-genesis-2-0-child-themes ... if anyone is interested.
- <span class="medium">Closing date: </span>' .get_field( 'closing_date' );
-
AuthorPosts