akumarks
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [Vantage] Adding icons to Navigation menuSurprised there isn’t a straightforward way of doing this. This solution works fine.
But, isn’t surely the best way of achieving what is required.
The above code had temporarily fixed my problem. But, my theme reviewer recommended I do something different. Here’s a code he provided that works great on my theme:
function ggl_load_styles() { if (!is_admin()) { wp_register_style('googleFont', '//fonts.googleapis.com/css?family=Cuprum:400,400italic,700,700italic&subset=latin,cyrillic'); wp_enqueue_style('ggl', get_stylesheet_uri(), array('googleFont') ); } } add_action('wp_enqueue_scripts', 'ggl_load_styles');My Google Font URL uses just the Font styles like //fonts.googleapis.com/css?family=Roboto|Lato
You could also add the style.css through wp_enqueue_style in functions.php and remove the style.css declaration from header.php as the above code may cause conflicts with your style.css.
One of my themes is being reviewed and I got the very same error. Had a hard time finding the solution. Found it here – http://gregrickaby.com/add-google-fonts-wordpress-right-way/
Replace the above code in your functions.php with the following –
function load_fonts() { $protocol = is_ssl() ? 'https' : 'http'; wp_register_style( 'google-fonts', "$protocol://fonts.googleapis.com/css?family=Cuprum:400,400italic,700,700italic&subset=latin,cyrillic" ); wp_enqueue_style( 'google-fonts' ); } add_action('wp_print_styles', 'load_fonts');Hope this works…
Forum: Themes and Templates
In reply to: Is get_next_post() function deprecated?Jose, thanks for the reply. I solved this issue.
I was talking about the Log Deprecated Notices plugin. It is a recommended plugin by WordPress for theme developers. It generates a log with all kinds of errors. Unlike TAC, you will have to clear the log after making any changes to see if the errors still show. I had already solved all the errors and the log was showing historic data.
So, the get_next_post() and get_previous_post() are in fact NOT deprecated.
Thanks again Jose, have a good one…
Forum: Themes and Templates
In reply to: Where should I include post_class in my theme?I have two post queries in my index.php file. The first one shows the latest post in a big box at the very top. More like a featured post box, but shows the latest post. The code for that is the one I pasted above.
The second query loads the remaining posts in a list below the latest post box. The code for that is –
<?php if (have_posts()) : while (have_posts()) : the_post(); if( $post->ID == $do_not_duplicate ) continue;?> <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="panel-body"> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <p><?php the_excerpt(); ?></p> </div> </div> <?php endwhile; endif; ?>Forum: Themes and Templates
In reply to: Where should I include post_class in my theme?Thank you for your input Esmi.
Stephen, I did what you mentioned above and Theme Check doesn’t show any errors. My site’s content doesn’t break as well, so, it does seem to be working.
Now my code is –
<?php $my_query = new WP_Query('posts_per_page=1'); while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID; ?> <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="jumbotron"> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <p><?php the_excerpt(); ?></p> </div> </div> <?php endwhile; ?>My question is will the multiple div elements, ie. the post-<?php id and jumbotron cause any problems?