samsm
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: An alternative to <?php the_ID(); ?>Slightly shorter:
commentCount($post->ID); ?>
Forum: Fixing WordPress
In reply to: Hierachy of categoriesI don’t know exactly how to do what you want off the top of my head, and it is too time intensive for me try and test. However, here’s what I’d try, maybe you can try it.
To accomplish what you want, there are two changes that need to occur, both in the index.php file of your theme.
First, you need to limit the index page to three days. I’ve asked about showing odd timespans of posts and I’ve looked in the source. I don’t think it’s possible without hacking though I’d love to be corrected. You can, however, show the last week, or show today, yesterday, and the day before in three steps. Try out tossing various query strings (the part after the question mark in your urls) into query_posts(‘query_string_here’) before “the loop”.
Second, you need to change the category links so that they contain the posts_per_page code mentioned above in the query string. Neither list_cats nor wp_list_cats allows this directly, perhaps a filter would do the job. Or, you can forgo changing the category links, and instead change the query string in the category.php theme page.
Forum: Fixing WordPress
In reply to: Post listquery_posts () might be the tool you are searching for.
Switch to the default theme for a moment and check out the query string when you click upon a category link. By query string, I mean the portion of the url after the question mark. For example:
cat=1
Yeah. Anyway, you can replicate the effect of visiting a category page by using
<?php query_string('cat=1'); ?>
… followed by standard “loop” syntax for actually displaying posts.
Forum: Fixing WordPress
In reply to: See a category page?If you want to create a list of the categories dynamically, you might alter your theme so that the page you wish to show categories contains:
<?php wp_list_cats('sort_column=name'); ?>
As a matter of practicality, if categories do not change often, I think Jobbok’s suggestion is quite sound. You might “cheat” by adding the php I’ve suggested to a theme you are using and them copying and pasting the resulting html into a page. Wouldn’t take long at all and the result would actually be easier on your server than generating the list dynamically each time..
Forum: Fixing WordPress
In reply to: Broken theme…. any ideas?The template line in the stylesheet is only needed if you want to base your theme on another theme. So if the template line isn’t there and everything works fine, don’t worry. ??
rehash: if you raen’t basing your theme on another theme, the template line in style.css isn’t needed.
Forum: Fixing WordPress
In reply to: Broken theme…. any ideas?When I had this error happen to me, it was because I wasn’t referencing the template correctly. In other words this line in style.css was wrong:
Template: name-of-template
It should have been:
Template: case-sensitive-directory-name
(on one line)Hope that was your problem too. ??
Forum: Fixing WordPress
In reply to: Am I missing somethingIf there are still gaps once I understand WordPress a little better then I probably will contribute as best I can.
I probably sounded judgemental about documentation shortcomings … I really just meant it as a statement of fact. The question titling this thread is “Am I missing something?”. Truth is, some things are missing from the documentation at this time and date. I spent a lot of time with fruitless searches coming to that conclusion, I’m just hoping to save someone else some time so they can investigate getting help from other avenues.
As the documentation continues to develop, hopefully that point will become invalid.
Forum: Fixing WordPress
In reply to: Am I missing somethingAs far as I can tell, there are holes in the documentation.
query_posts is a good example of one. Another example: the_post(). The pages that are there are nice, but there is an entire layer that seems to be missing.
Forum: Fixing WordPress
In reply to: Subcategory Menu StructureAnswered:
https://www.ads-software.com/support/topic.php?id=24319Answered again!:
https://www.ads-software.com/support/topic.php?id=24199(Hope one of those helps!)
Forum: Fixing WordPress
In reply to: Titles for page groupsI think the way you showed in post 3 looked good to me.
I am not surprised that pages don’t have categories like links. The link categories take up an extra database table. If you were to do the same for pages, and then another feature and then another feature, next thing you know you are looking at an incomprehensible mess in the database. That’s the way I look at it at least.
I am a bit surprised that the pages aren’t allowed to have categories like posts. Since pages are stored in the same table as posts, this might not be too huge of a deal. Still, there would be some degree of bloat and some degree of confusion. For example, when you list a category, do you show the pages and posts? Which comes first? Should someone make special code to display only the categories that hold only pages or vice versa? One thing leads to another.
One option that occurs to meas a potential solution for you is to forego using pages and use posts instead… alter a theme to create a separation and make certain posts look like pages.
Forum: Fixing WordPress
In reply to: Hierachy of categoriespublius, I don’t know, but I have something you may want to check out.
I just looked at the source and found this, which appears that one can alter the limit with the query string.
$limits = "LIMIT ".$pgstrt.$q["posts_per_page"];
Looks promising, and it appears to do something.
Compare
https://www.publiuspundit.com/index.php?cat=1
to
https://www.publiuspundit.com/index.php?cat=1&posts_per_page=100However, I have reason to think it doesn’t exactly do what you want. Certainly try it out if you like, though.
Forum: Fixing WordPress
In reply to: Articles from a given time rangeOk, I’ve done some more looking into this.
It appears to me that one could accomplish what I want with a hack to WP_Query->get_posts(). You could basically build the request like you would any other, taking advantage of wordpress’s features. but swap in your own query instead of the wordpress constructed one.
However, this seems a little brutal to me. Am I missing an easier method?
Forum: Fixing WordPress
In reply to: Titles for page groupsOne way to accomplish groupings with pages might be to create a page for each heading and make that page the parent of pages you want in that particular grouping. Not sure you would want it that way.
Another way (and this seems attractive to me if you don’t have many pages) would be to delete the wp_list_pages function call and just hand code, in html, the permalinks as you like them onto the template. Kind of rustic.
Forum: Fixing WordPress
In reply to: Category IndentsIt’s not a CSS matter, if you look at the html source of the categories you will see that there is no differentiation between parents and children.
I’m new to WordPress, but I’m gathering from this post I visited recently, that something changed between 1.2 and 1.5… it’s possible 1.2 threw a non-breaking space in to create child offset… or whatever, beats me. Anyway, if you feel bold enough to edit the theme, changing the categories to
<li>
sts should create the logical separation needed for you to control the appearance of the lists with css.Basically, in themes/benevolence/sidebar.php:
<?php wp_list_cats("list=0"); ?>
becomes:
<?php wp_list_cats("list=1"); ?>
Forum: Fixing WordPress
In reply to: get_links_list sort problemI just tried out get_links_list(‘name’) and had the same experience as you.
The long version…
get_links(-1, '<li>', '</li>', '<br />', FALSE, 'name', TRUE,TRUE, -1, TRUE);
… seems to work acceptably.
That function and its arguments are detailed here: codex: get_links().