David G. Johnson
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: RSS URL errorNot sure it will be possible to diagnose this without taking a peek at your real site.
Can you post the URL?
Forum: Plugins
In reply to: [Weekly Class Schedule] WCS Widget BugI put together a slightly modified version of this code which is working well for me in version 3.11 of the plugin and WP 3.9.2 over here:
http://wordpress.org/support/topic/todays-classes-widget-shows-hidden-classes?replies=2#post-5892144
Thanks to both of you for posting!
Forum: Plugins
In reply to: [Weekly Class Schedule] "Today's Classes" Widget shows "hidden" classesAlright, thanks to @chakradeo and the patch he referenced in his previous response, my clients’ site is now displaying only the “Visible” classes in the Weekly Class Schedule widget, rather than ignoring the “Visible” vs. “Hidden” setting.
However, since his response was formatted as a patch, and the subsequent commenter modified the code somewhat, I’m including below the exact modifications I made so that others who need to make this change can perhaps do so a bit more easily.
In the wcs3_widgets.php file (found in the plugin’s includes directory), locate the line that reads
$output .= '<ul class="wcs3-today-classes-widget-list">';For me, this was line 59. Here’s what I have edited beginning two lines below that point:
// Original Widget Code Below /* foreach ( $schedule as $key => $entry ) { $start_hour = $entry['start_hour']; $class_name = $entry['class']; $output .= "<li>$start_hour - $class_name</li>"; } $output .= '</ul>'; */ // Modified Widget Code foreach ( $schedule as $key => $entry ) { if($entry['visible'] != 'Hidden') { $start_hour = $entry['start_hour']; $class_name = $entry['class']; $output .= "<li>$start_hour - $class_name</li>"; } } $output .= '</ul>';This effectively replaces the code that previously ended with the last line I included above (the one that reads
$output .= '</ul>';I hope this is clear for users that may perhaps be less experienced with PHP code. It’s working perfectly for me.
Thanks!
Forum: Plugins
In reply to: [Weekly Class Schedule] "Today's Classes" Widget shows "hidden" classesThanks for this response, @chakradeo.
I had seen the post you referenced after considerable searching here in the forums, but I had also seen a reference in the changelog for the plugin to a fix in version 2.0.4 that said, “Fixed issue where Today’s Classes widget display hidden classes.”
Since I couldn’t correlate the date of that version with the date of your post, and since there were no other references in the changelog to this functionality in the widget, I had hoped that the plugin dev had either incorporated your change already or had otherwise fixed this issue. I’m making the changes you recommended to the file
wcs3_widgets.phpin theincludesfolder of this plugin. Once I test, I’ll report the results back here.Thanks again!
Hi mrsztuczkens, thanks for the response.
Actually, I have no explanation for this. Between the time I started this topic and the time I saw your response, I can think of absolutely nothing that has changed on the site.
In fact, I just tested the “Pin It” button to confirm, and it appears that the issue has been resolved.
I’m sorry I don’t have more info for you. You’re welcome to message me privately if more info would be helpful for the purposes of supporting your plugin.
Thanks again!
Forum: Themes and Templates
In reply to: Best Coding Method For TaskHi TCOG,
The way I understand your question, it seems that a WordPress “Custom Post Type” may be the ideal way to get this done.
Some theme developers have created themes which allow you to utilize a custom post type and display content the way you’re describing.
However, you could also use a plugin like Custom Post Type UI to accomplish this.
I don’t have experience with that particular plugin, but there are others. A quick search of the plugin repository using the phrase “custom post type” pulled up quite a few.
Essentially the idea is this: you create a custom post type called “wines.”
Each wine then becomes a “post” (of that custom post type). You could use the “featured image” to output a primary image for each wine. The “title” field would be for the name of the wine.
You could then use taxonomies to handle classifications (much like we use tags and categories for WordPress posts now) such as “type” (i.e. I’m thinking cabernet, merlot, chardonnay, reisling) or maybe “vineyard” or “vintage” and so on.
You could then create a couple of page templates to handle output of the content: one for lists of wines (like a simple version of the WordPress loop that only queries your new custom post type and outputs them styled the way you want), and perhaps one for a single post (a detail page for a given wine). You could potentially modify your theme’s “archive” template to show archives for your custom taxonomies.
This is a real quick and dirty attempt to describe the approach. You’ll probably run into some additional questions along the way. Custom post types are pretty killer once you start dabbling with them though.
Cheers!
Forum: Fixing WordPress
In reply to: How to Put Ad on Header?Hi albnaldo,
You sure could — it’s kind-of a design taste question. If you wanted to accomplish that, then you might create a
<div>specifically for adsense and float it to the right using CSS.This would allow you to control margins, padding and other characteristics of your div tag via CSS as well.
Hope this helps!
Forum: Fixing WordPress
In reply to: Delete Blog QuestionYou’re welcome!
Forum: Fixing WordPress
In reply to: Implementing WP in HTMLHi setshot50,
Yes. What you’re trying to accomplish is doable. In fact, integrating WordPress instead of using an iFrame is the best way to get the content (posts) from WordPress without any styling.
The link I mentioned previously provides great info, but perhaps some additional amplification will help you get going.
First things first: you’re going to want to change that .html file into a .php file.
Then, at the top of the file, you’ll want to include this bit of code before your HTML output starts (even before the
<!DOCTYPE>declaration:<?php require('/the/path/to/your/wp-blog-header.php'); ?>Obviously you need to change the path there. From what I can see for the page you linked to, it might look like this:
<?php require('../../../wp-blog-header.php'); ?>This code essentially “calls” WordPress and says “I’m planning to query you on this page.”
Then, once you get to the portion of your page where you’d like the posts to appear, you could use code like this;
// Get the last 3 posts. <?php global $post; $args = array( 'posts_per_page' => 3 ); $myposts = get_posts( $args ); foreach( $myposts as $post ) : setup_postdata($post); ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a><br /> <?php endforeach; ?>This code (above) is a very, very basic version of what is known in WordPress parlance as “The Loop.” It is highly, highly customizable.
The super-simple version above would pull up the last 3 posts and output them into your page’s html code.
For starters, you could try putting that code into your page after this line:
<div class="innercontent">Everything coming out of WordPress at that point would obey the CSS rules for your “innercontent” ID.
If you wanted the WordPress post titles to have an
<h2>tag, then you would modify the above code as follows:// Get the last 3 posts. <?php global $post; $args = array( 'posts_per_page' => 3 ); $myposts = get_posts( $args ); foreach( $myposts as $post ) : setup_postdata($post); ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><h2><?php the_title(); ?></h2></a><br /> <?php endforeach; ?>The options you have are (nearly) endless. You can display an excerpt of your post(s), the entire post content, permalinks to the posts with the titles, only the titles (with or without links), and additional stuff like your category(-ies), tags, author(s), etc.
If you’d like to give this a shot and let me know if you have specific questions about modifications you’d like to make, I’d be glad to provide some additional help.
Forum: Themes and Templates
In reply to: Help with header / logo / descriptionYou’re welcome, dtfkev!
Unfortunately, I may have sent you on a wild goose chase with the “hooks.” Apparently not all of their themes make these readily accessible. The “Canvas” theme does, but it is clearly the most user-configurable theme they produce.
You’re correct about the reasoning behind a child theme. If you were to add something to your current theme’s header.php file (which you could certainly do), you run the risk of losing that change and having to make it again when you update the theme.
Unfortunately, CSS is only going to help you if content is being retrieved by the PHP code in your header file. Most likely, WooThemes is not even retrieving the “tagline” (“description”) if you upload an image to the logo area.
Let us know how this turns out for you!
Forum: Fixing WordPress
In reply to: Implementing WP in HTMLHi setshot50,
Using iframes to display content from a WordPress blog could get messy pretty quickly, depending upon what you’re trying to accomplish.
You might consider integrating WordPress into the website using PHP. This page in the codex gives some quick examples and the basic code needed to make calls to WordPress so that it outputs the content into whatever page(s) you’d like to have it appear.
If you take this route, the WordPress posts will be “themed” by the CSS on the site you’re integrating them into. The actual WordPress theme won’t really matter so much.
This is just enough to provoke some thought. If you’d like more help, perhaps you could provide some additional details on exactly what you’re trying to accomplish. A link to what you’re working on might be helpful also.
Cheers!
Forum: Fixing WordPress
In reply to: Delete Blog QuestionLooks like Forensica Digital and I were both typing up answers at the same time. Either method will give you a copy of both your database and your files.
Forum: Fixing WordPress
In reply to: Delete Blog QuestionTo have a complete copy of everything, you’ll need to back up both the “files” and the “database” for your WordPress site.
There are a number of ways to accomplish this.
One rather straightforward method is to use a plugin like WP-DB-Backup to turn all of your database content into “files” on your web host.
Then, you can connect to your web host via FTP and copy all of the files to your computer. If you’ve first backed up the database to your files (the plugin I mentioned will place the database backup inside a folder in the ‘wp-content’ folder of your WordPress files), then by downloading all of the files you will effectively be backing up everything: your entire WordPress installation (settings, theme, etc), content (posts, pages, etc) and uploads (images, files, etc.).
One caveat here: the process above makes a true backup of WordPress. It won’t be particularly useful without “restoring” it somewhere (e.g. to another web host). It is possible to set up a local installation of WordPress on your computer, however, if you need to have access to all of this. That’s a bit more advanced, however.
Just as I was about to publish this answer, I re-read your question. It made me realize that there are a few possibilities about how your blog is configured. So let me clarify: my answer (above) assumes that your WordPress blog is actually hosted in your HostGator account. You mention that HostGator is your “website” host. For many of us, that means that your website is built on WordPress. If that’s the case, then this answer will apply.
If, however, your “website” and your WordPress blog are two different things, then we’ll need to know more about how everything is set up.
Forum: Fixing WordPress
In reply to: How to Put Ad on Header?There is probably more than one good way to approach this. But, depending upon exactly what code you plan to add, you might consider inserting it right after this line:
</div><!-- .logo -->in your theme’s header.php file.
Also, in order to help your edits survive any future updates to your theme, you might consider making a child theme and placing your code into a copy of header.php.
Hope this helps!
Forum: Fixing WordPress
In reply to: broken /wp-admin directoryDo you currently have identical values in Settings > General for “WordPress Address (URL)” and “Site Address (URL)” for this site?