Get date function not working
You have to pass the second parameter $post to get_the_time(‘j’): get_the_time( ‘j’, $post ); If you don’t WordPress will just use whatever the current global post object is.
You have to pass the second parameter $post to get_the_time(‘j’): get_the_time( ‘j’, $post ); If you don’t WordPress will just use whatever the current global post object is.
Use this function to get current cateogry in wp : function getCurrentCatID(){ global $wp_query; if(is_category() || is_single()){ $cat_ID = get_query_var(‘cat’); } return $cat_ID; } echo getCurrentCatID(); Just found for you, try this, if(isset($wp_query->get_queried_object()->cat_ID)) { $cur_catId = $wp_query->get_queried_object()->cat_ID; } if(issset($wp_query->get_queried_object()->ID)) { $cur_postId = $wp_query->get_queried_object()->ID; }
OMG – i falied to clean “$selected” value… hope this helps someone if you get confused for a moment like i did <?php $postId = $_POST[‘postid’]; // the value is recieved properly $currentCategory = get_the_category($postId); // the value is recieved properly $currentCategoryId = $currentCategory[0]->term_id; // the value is assigned properly $categories = get_categories(‘hide_empty=0’); // the … Read more
This: <nav> <?php wp_nav_menu( array( ‘theme_location’ => ‘main-menu’ ) ); ?> </nav> . Should be: <nav> <?php wp_nav_menu( array( ‘theme_location’ => ‘main-menu’, ‘menu_class’ => ‘main_menu’ ) ); ?> </nav> The css: .main_menu { font-size: 14px; // example } . Learn more here: wp_nav_menu Best of luck, Sagive
<?php wp_nav_menu( array( ‘items_wrap’ => ‘%3$s’ ) ); ?> Source http://codex.wordpress.org/Function_Reference/wp_nav_menu#Removing_the_ul_wrap
amit helped you out, but while we’re at it you really shouldn’t be echoing everything like that. Should probably try this instead: <?php foreach ( $videoID as $value ) { ?> <div class=”video-pops”> <a class=”thumb video-pop-lb” data-video-pid=”<?php echo $videoID; ?>”></a> <?php } ?> And so on. You may even be better off using the alternate … Read more
just use the code below <?php if ( ! is_home() ) { if ( get_post_type() == ‘pretty-little-liars’ ) { echo ‘<div id=”headerimg”><img src=”http://tv-cafe.com/wp-content/uploads/2012/08/liars.png”></div>’; } if ( get_post_type() == ‘revenge’ ) { echo ‘<div id=”headerimg”><img src=”http://tv-cafe.com/wp-content/uploads/2012/08/revenge.png”></div>’; } }
Find the post thumbnail reference in your homepage template, or content-{single?}.php -whatever is generating the 180×180 image and change it to: <?php the_post_thumbnail( ‘full’ , array(‘class’ => ‘home-page-thumbnail’) ); ?> and add the following to your style.css file: .home-page-thumbnail { clear:both; }
You should not use mysql_fetch_array() Use wordpress built-in functions, like this: $SQL = “SELECT * FROM pt_country ORDER BY name”; $rows = $wpdb->get_results( $SQL ); foreach($rows as $r){ print_r($r); }
There is a capability called edit_theme_options which is by default assigned to only site admins not to editors. Check out – Roles Vs Capabilities . To allow your editors to manage theme options you’ve to manually assign that capability to editors. Here to assign edit_theme_options capability to editors just drop in this code into your … Read more