aegisjester
Forum Replies Created
-
It is not quite as simple as specifying just the parent category, but you can accomplish the same task using multiple taxonomy queries and excluding the children explicitly.
https://github.com/billerickson/display-posts-shortcode/wiki#multiple-taxonomy-queries
An example would be if you had a category “Parent” and sub-category “Child”. If you wanted to show just posts in “Parent” but are not in “Child”, the shorcode would be:
[display-posts taxonomy="category" tax_term="parent" taxonomy_2="category" tax_2_operator="NOT IN" tax_2_term="child" ]
You would need to add another operator (taxonomy_3, tax_3_operator, tax_3_term, ect) for each child category you want to exclude.
Bad formatting above, everything that is randomly linking is because I meant to say the a element (for links)
I’ve done this myself using CSS, the title has the class” title”, so you could use a selector like “.shortcode .title”, and the method here for truncating to one line:
https://css-tricks.com/snippets/css/truncate-string-with-ellipsis/It basically boils down to specifying the max width of the line, then disallowing text wrap (and truncating with an ellipsis), its pretty flexible depending on what you’re trying to do.
I also use this method to truncate my post excerpt to one line, with the title above and the “Continue Reading” below:
.homenews-posts .excerpt { display: inline-block; overflow: hidden; white-space: nowrap; text-overflow:ellipsis; width: 380px; font-size: 11px;} .homenews-posts .title {color:#239CE4;font-weight:bold;} .homenews-posts .listing-item{ display:block; margin: 10px 15px -10px 0; padding:5px;} .homenews-posts .listing-item img{ display:none;}
Forum: Themes and Templates
In reply to: [i-excel] Mobile OptimizationI had the same problem, I was able to fix it by changing the viewport in the header.php
default:
<meta name=”viewport” content=”width=device-width”>changed to:
<meta name=”viewport” content=”width=device-width, initial-scale=1″>After that, it looks great on all devices
Forum: Fixing WordPress
In reply to: ?> at the top of all pagesThat was it, thanks!