Sphinx Sword
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Associate a category to a table<?php global $more; $more = 0; ?> <table class="breves-posts"> <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $count=0; if(query_posts("showposts=10&category_name=BREVES&orderby=date&order=DESC&paged=$paged")) : ; while(have_posts()) : the_post(); ?> <tr> <td class="breves-item"> <a href="<?php the_permalink(); ?>"> <?php if( has_post_thumbnail() ) { ?> <?php the_post_thumbnail(); ?> <?php } else { ?> <?php } ?> <h1 class="title"><?php the_title(); ?></h1> <span class="date"><?php the_time('F j, Y', '', ''); ?></span> <span class="content"><?php the_content(); ?></span> </a> </td> </tr> <?php endwhile; endif; ?> </table> <!-- add your themes pagination function here --> <?php wp_reset_query(); ?>
The above code will call posts in the category “BREVES”. This is accomplished by the part of the code that reads “category_name=BREVES”.
The posts will be ordered by date and in descending order.
The featured image is called by this:
<?php if( has_post_thumbnail() ) { ?> <?php the_post_thumbnail(); ?> <?php } else { ?> <?php } ?>
Below that is the code for the title, date and content.
These posts will also be paged with 10 posts per page. You can change the number of posts per page by changing “showposts=10” to any number you want. In order for the pagination numbers to show up, remove the commment seen below and add your themes pagination code:
<!-- add your themes pagination function here -->
You can style the posts with CSS and make them look any way you want.
Forum: Themes and Templates
In reply to: [Theme: Premium News] Exclude a category from a sectionTo get the ID of a category, in the dashboard’s sidebar go to “Posts” then click on “Categories” from the list that appears when you hover over “Posts”. If you use Firefox, when you hover over the category link, in the lower left of the window you see the url of what you are hovering over. Something like:
Toward the end of that link you will see “ID=” and then a number. That number is the ID of the category. Each category has a unique ID. In the url above the ID is 9.
If you use Safari you need to make sure the “Status Bar” is visible to see the url at the bottom. You can turn the “Status Bar” on by going under “View” in the menu area.
Forum: Fixing WordPress
In reply to: Turning off hyphenatingIn the dashboard sidebar, go to “Appearance”, then click on “Editor”. Scroll down to the bottom and on the right-hand side under “Styles” find “Stylesheet (style.css)”. That is the master style sheet. You may also find this CSS “hyphen:auto;”
You’ll want to remove those.
Forum: Fixing WordPress
In reply to: Turning off hyphenatingRW – The above CSS will word-wrap. I just saw this hyphen situation recently happen in WordPress. I think it is a part of their responsive theme upgrades. Some developers think it is better to have hyphens because they say it makes it easier to read when the screen size changes. I prefer no hyphens, but maybe there is another reason I don’t know about.
Forum: Fixing WordPress
In reply to: Turning off hyphenatingIn your CSS you can add this to elements, like the paragraphs:
p { -moz-hyphens: none; -ms-hyphens: none; -webkit-hyphens: none; hyphens: none; }
Forum: Themes and Templates
In reply to: [Theme: Premium News] Exclude a category from a sectionOh and remove this:
,-' . $GLOBALS[ex_breves] . '
Forum: Themes and Templates
In reply to: [Theme: Premium News] Exclude a category from a sectionYou need to find the ID of the category “Breves” and then add “cat=-X” where “X” is the ID of “Breves”. So if “Breves” has an id of “3”, Your code would look like this:
$the_query = new WP_Query('cat=-'. $GLOBALS[ex_feat] . ',-' . $GLOBALS[ex_vid] . ',-' . $GLOBALS[ex_breves] . '&showposts=' . get_option('woo_other_entries') . '&orderby=post_date&order=desc&cat=-3');
If you need to exclude multiple categories, you would seperate the ids with commas like this: cat=-X,-Y,-Z