patrick_here
Forum Replies Created
-
Forum: Plugins
In reply to: [Hide My Site] Is single log-in possible?Okay but o2/p2 seems to be more of a forum-like theme. My application needs the blog posts/pages to retain the character of pages in a notebook (or normal blog posts) …not posts in a forum. But thanks very much for the suggestion.
Forum: Fixing WordPress
In reply to: Understanding the body_class() functionGlad I’ve finally been able to get the bottom of this problem. It turns out that when I added custom-background support to two of my sites, I was following the advice of some posts on the web that recommended the use of the body_class() function for custom-background.
For anyone reading this thread who is adding custom-background to an existing website, I would strongly advise against the use of body_class() for this purpose. I fixed the problem by simply hardcoding my <body> tag (in header.php) like this:
<body class=”custom-background”>
…that’s all that’s needed to make custom-background work on an existing theme – and then there’s zero danger of breaking existing code. The body_class() function might be fine for developers developing a new theme or new website but for an existing site with existing CSS, I think body_class() is an invitation to disaster (unless you are a CSS expert …with lots of spare time). It’s too easy to break existing functionality with the body_class() function on a running site that was developed without it.
(But Esmi if you feel differently about it I’d be interested to hear what you have to say).
Forum: Fixing WordPress
In reply to: Understanding the body_class() functionHello Esmi …thank you for chiming in here! I was hoping you would comment because you clearly know the right answer.
Yes, overwriting the CSS seems like the proper solution.
From my perspective, it seems that it would be helpful to mention your statement in the documentation for the function: “The body_class() simply adds a whole range of potentially useful classes to the body tag depending upon what template is being used”.
Thanks again. I think your advice resolves it!
Forum: Fixing WordPress
In reply to: Understanding the body_class() functionUnless I’m missing something, this seems like a WordPress Bug to me…
It seems that the body_class() function makes assumptions about CSS Classes that the user has defined and that these assumptions are not properly documented. Apparently, if is_archive() is TRUE and is_category() is TRUE then the user’s styles.css must contain a suitable definition of a “category” class. But there is no mention of this in the wordpress page about the function.
Essentially, this seems to be a case of undocumented hardcoding – “category” class is hardcoded into the function without any mention in the documentation page. (is it at least documented elsewhere?)
Forum: Fixing WordPress
In reply to: Understanding the body_class() functionCorrection:
On the other sites using the same theme – that don’t exhibit this behavior, I’m not calling the body_class() function at all in the header.php for those sites. I suppose I put in the call to body_class() only on two sites where I was adding custom-background …and so on both of them the call to body_class is adding the “category” class to the list of classes. And looking at the code in post-template.php, I see:} elseif ( is_archive() ) { if ( is_post_type_archive() ) { $classes[] = 'post-type-archive'; $post_type = get_query_var( 'post_type' ); if ( is_array( $post_type ) ) $post_type = reset( $post_type ); $classes[] = 'post-type-archive-' . sanitize_html_class( $post_type ); } elseif ( is_author() ) { $author = $wp_query->get_queried_object(); $classes[] = 'author'; if ( isset( $author->user_nicename ) ) { $classes[] = 'author-' . sanitize_html_class( $author->user_nicename, $author->ID ); $classes[] = 'author-' . $author->ID; } } elseif ( is_category() ) { $cat = $wp_query->get_queried_object(); $classes[] = 'category';
So in my case it would seem that it’s adding the ‘category’ class because is_archive() is TRUE and (probably) is_category() is true! (haven’t yet tested/verified this to be 100% certain)
Not sure why that makes sense …I suppose that for a fix perhaps I don’t have much choice other than to do what I’ve already done (remove the “category” class with add_filter() ).
Forum: Fixing WordPress
In reply to: Understanding the body_class() functionThe theme is an end-of-life’d one that was once popular: Arthemia “Free” …I’ve added customizations to it.
What’s rather strange about all this is that I”m using the same theme on other sites and only two of them are exhibiting this behavior. The only unique shared characteristic I can find about those two sites is that they are the only ones to which I have added custom-background functionality (ie: in functions.php). But when I comment-out the custom-background code, the problem doesn’t go away (even after disabling and re-enabling the theme).
Forum: Fixing WordPress
In reply to: Understanding the body_class() functionHmmm… That wphierarchy reference is very helpful…
Yes, there is no category.php…So it turns out that the theme’s index.php – which is used to display the front page – does include a section with “category” class …there are links on the front page so that the user can click on a category to see all posts in that category. But then when the user clicks on a specific category, they are taken to a page that is output by archive.php and on that page there is really no reference to “category” class at all (but there is a rel=”category” attribute in the hyperlink for each category in the list of categories associated with each post). But the call to “body_class()” outputs the “category” class nevertheless (the call itself is in header.php and the first line of archive.php includes it with a call to “get_header()” ).
Forum: Fixing WordPress
In reply to: Understanding the body_class() functionYes, I saw all those pages and – as mentioned in the original post – I already implemented the workaround of removing a class from body_class() but would prefer to get to the bottom of how this function decides which classes to include in the list.
Forum: Fixing WordPress
In reply to: Understanding the body_class() functionThank you Steve…
So I installed “show current template” and I see that on the page with this problem, archive.php is the template being used. When I look at my “archive.php” I do not see the “category” class being used.So now what?
Forum: Plugins
In reply to: [SlimStat Analytics] How to display hit counter in footerSo do you mean to tell me that with all these 100,000+ users of Slimstat, no one has developed a plugin to display a “Hit Counter” in the footer of a wordpress blog – using the count from Slimstat?
Forum: Plugins
In reply to: [SlimStat Analytics] How to display hit counter in footerYes it works!
Suggestion: I’d suggest you keep working on improving the documentation.
Thank you. I gave you a recommended rating and bought one of your addons!
Forum: Plugins
In reply to: [SlimStat Analytics] How to display hit counter in footerCamu,
Thanks for the link. I looked at that link you supplied and at
https://slimstat.freshdesk.com/support/solutions/articles/5000684596-database-api-methods…But was not able to get it to work properly. I see that the documentation says that the syntax for the “init()” and “count_records()” functions is similar to syntax for shortcodes but looking at the shortcode documentation I don’t see how to do the translation/transition from one to the other.
Basically all I want to do is retrieve the count of all unique IP visitors from the start of time.
Thanks in advance for the help.
Forum: Plugins
In reply to: [footnotes] TinyMCE button doesn't workI’m seeing the same problem – the button in tinyMCE seems to do nothing. (entering the footnote tags manually does work, however)
Forum: Plugins
In reply to: [Advanced Page Manager] Feature RequestAnother problem: I just discovered that Advanced Page Manager seems to store its own hierarchy …independent of the WordPress Hierarchy. This seems incorrect to me – WordPress already provides for a built-in page hierarchy system by giving the user a way to specify a parent page. If your plugin is going to setup a separate independent hierarchy I think it should give the user the option of using the built-in hierarchy also. This way if -for example- the user is using the plugin on a pre-existing site that already has many pages arranged in a parent-child hierarchy, they will not have to go back through to every page and duplicate the hierarchy for “Advanced Page Manager” (one mistake and the two systems are differing with each other). This is a big problem, as I see it.
Forum: Fixing WordPress
In reply to: Removing query_posts()Okay, I’ve managed to eliminate that first call to query_posts() but my index.php still has a prior call to query_posts() that I can’t remove because it uses a custom taxonomy that I defined and I’m passing the custom taxonomy as an argument to query_posts(). It looks like this:
<?php $args = array('homepageposts' => 'Featured'); query_posts($args); ?> <?php while (have_posts()) : the_post(); ?>
I think I need to get rid of all of the calls to query_posts() because prior calls to query_posts() will mess up the subsequent sections where I’m trying to eliminate them. Any advice as to what to do about this call to query_posts() of a specific taxonomy?