If in category to be inside of a function

If you want to use the function to output the code somewhere: function displayImage($currentPost) { // Show the featured icon only if current post is in “featured” category if ( in_category ( ‘featured’, $currentPost ) ) { $output=”<a href=”https://wordpress.stackexchange.com/questions/58811/<?php the_permalink(); ?>”> <span class=”featured_icon”> <img src=”<?php bloginfo(“template_directory’); ?>/images/featured_icon.png” /> </span> </a>’; } else { $output=”” }; … Read more

WP-Markdown treating java generics like HTML tags

I was trying to fix this for the longest time as well. It seems that the problem is not the rendering, but the editor – when you save, it updates your post. I found a checkbox under Settings -> Writing called “WordPress should correct invalidly nested XHTML automatically”. Unchecking this checkbox fixed the problem.

How to fix a “globals” issue to avoid a rejected theme?

If you’re dealing with framework that holds values in a global variable then there isn’t much you can do about it. Here is an example of wrapping the variable in a static getter. if ( ! class_exists( ‘SMOFData’ ) ): class SMOFData { static public function is( $key, $compare ) { $value = static::get( $key … Read more

Remove line breaks from ?

WordPress assumes that you use <code> for inline code and <pre> for a box of code. In your case, then, you shouldn’t have any need to use <pre><code> but just <pre> See: Writing Code in Your Posts

Cannot find the code for “Edit This” link in posts in a specific theme

This should be located in the entry-meta.php file of the parent theme (kuorinka). Here is the code: <?php if ( ‘post’ == get_post_type() ) : ?> <div class=”entry-meta”> <!– Date & Author name–> <?php kuorinka_posted_on(); ?> <!– Comments count –> <?php if ( ! post_password_required() && ( comments_open() || ‘0’ != get_comments_number() ) ) : … Read more

How to display posts of specific category using a custom Query in WordPress?

the recommended way is: <?php $query = new WP_Query(‘category_name=Category&posts_per_page=4’); if($query->have_posts()) : while($query->have_posts()) : $query->the_post(); if (has_post_thumbnail()) { ?> <a href=”https://wordpress.stackexchange.com/questions/162985/<?php the_permalink(” ‘) ?>” title=”<?php the_title(); ?>”><?php the_post_thumbnail(); ?></a> <?php } ?> <h2><a href=”https://wordpress.stackexchange.com/questions/162985/<?php the_permalink(” ‘) ?>” title=”<?php the_title(); ?>”><?php the_title(); ?></a></h2> <?php the_excerpt(); // or the_content(); for full post content endwhile;endif; ?>

Code Friendly Block Quotes

Geshi In general the Geshi library is a popular library for formatting code ( http://qbnz.com/highlighter/) Geshi as a WordPress plugin For WordPress several authors “packaged” Geshi in a plugin. take your pick: http://wordpress.org/extend/plugins/search.php?q=geshi The one I use Personally I use this plugin: http://wordpress.org/extend/plugins/codecolorer/. This one works by enclosing all pieces of codes with a [cc … Read more

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