Help Combine These Two PHP Codes

here: <?php if ( has_post_format( ‘image’ )) { ?> <a href=”https://wordpress.stackexchange.com/questions/21659/<?php the_permalink() ?>”> <?php $image = catch_that_image(); if( $image ) { ?> <img src=”<?php echo get_template_directory_uri(); ?>/scripts/timthumb.php?src=<?php echo $image; ?>&amp;h=240&amp;w=280″ class=”index” alt=”<?php the_title(); ?>” title=”<?php the_title(); ?>” /> <?php } ?> </a> <?php } ?>

A better code for no post format?

I’m not sure I understand. Do you just want to join all the if-statements together? If that’s the case you could use elseif, like so: <?php $format = get_post_format(); if ( false === $format ) { echo ‘This is a default post’; the_excerpt(); } elseif ( has_post_format( ‘video’ )) { ?> A VIDEO POST <?php … Read more

How can I correctly redirect user to the submitted post and define a template for each new post in WordPress?

you need to get the ID from wp_insert_post and make sure you exit or die so: $pid = wp_insert_post($new_post); wp_redirect( get_permalink( $pid ); die(); As for the second part you can use the WordPress Template Hierarchy and simply name each one of your custom post type designs as single-{post_type}.php for example if your post type … Read more

“post-format” code snippets list [closed]

Using get_template_part() with Post Formats This is a really handy little snippet to use when you want to change the output format for each post format. if ( have_posts() ) : while ( have_posts() ) : the_post(); // Standard is the default template for posts with no post format // As the formats doesn’t contain … Read more

Adding link post format to theme and permalink to rss feed

as a self-appointed thematic support guru, i can simplify your first filter: /** * Override the post title logic for post format ‘link’ */ function mikewillsthematic_thematic_postheader_posttitle($posttitle) { if (has_post_format(‘link’)) { $posttitle=”<h2 class=”entry-title”><a href=””; $posttitle .= get_post_meta( get_the_ID(), “post_format_data”, true); $posttitle .= ‘” title=”Direct link to article” rel=”bookmark”>’; $posttitle .= ‘&#8734; ‘; $posttitle .= get_the_title(); $posttitle … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)