RoordaTim
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: How to Exclude Category from foreach loopI suppose the following will work:
<?php $i = 1; ?> <?php foreach ( $categories as $category ) : ?> <?php if ( in_array( $category->term_id, array( 4, 5, 6 ) ) ) : ?> <input type="radio" name="category" value="<?php echo $category->term_id; ?>" id="<?php echo $category->slug; ?>"<?php echo ( ! isset( $_POST['category'] ) && 1 == $i ? ' checked' : '' ); echo ( isset( $_POST['category'] ) && $_POST['category'] == $category->term_id ? ' checked' : '' ); ?> /><label for="<?php echo $category->slug; ?>"><?php echo $category->name; ?></label> <?php endif; ?> <?php $i++; ?> <?php endforeach; ?>
This would then exclude categories 4, 5 and 6. For more information about the php in_array() function, check the documentation.
Forum: Themes and Templates
In reply to: [Whispy] Problem with 3 columns on post/static pagesYou are welcome Sabrina! I suggest to mark this topic as closed and open a new one when needed, but I’m not a moderator of this forum, so may be I’m wrong.
Forum: Fixing WordPress
In reply to: How to Exclude Category from foreach loopHi jr99,
Maybe you can use the
query_posts()
function as described on this page. However you could also use the following, assuming you know the ID of the category you would like to exclude, say this ID is 4. Then you could use this:<?php $i = 1; ?> <?php foreach ( $categories as $category ) : ?> <?php if ( $category->term_id != 4 ) : ?> <input type="radio" name="category" value="<?php echo $category->term_id; ?>" id="<?php echo $category->slug; ?>"<?php echo ( ! isset( $_POST['category'] ) && 1 == $i ? ' checked' : '' ); echo ( isset( $_POST['category'] ) && $_POST['category'] == $category->term_id ? ' checked' : '' ); ?> /><label for="<?php echo $category->slug; ?>"><?php echo $category->name; ?></label> <?php endif; ?> <?php $i++; ?> <?php endforeach; ?>
Forum: Themes and Templates
In reply to: [Whispy] Width of header imageWhat is the link to your website?
Forum: Themes and Templates
In reply to: [Whispy] Problem with 3 columns on post/static pagesNo. That’s really poor advice and I know you mean well. ??
Thanks for your feedback, you are right. I’ll start using child themes from now on ;).
Forum: Themes and Templates
In reply to: [Whispy] Problem with 3 columns on post/static pagesI agree with Andrew, updating WordPress you should always do. There’s a difference between updating WordPress and updating the Whispy team. When you update WordPress, the Whispy theme is not changed and your modifications remain. When updating the Whispy theme all your modifications are overwritten (gone). Updating the Whispy team is not necessary to do, unless the WordPress update requires theme changes (due to adding/removing/modifying functions that the theme uses). This generally doesn’t happen often and when it does, it will be explained in the WordPress changelog. So don’t worry, keep on updating WordPress, but not the Whispy team.
It is also possible to create a child theme and/or use plugins, but I don’t think it is really necessary in this case.
Forum: Themes and Templates
In reply to: [Whispy] Problem with 3 columns on post/static pagesNo, what was only for line 993.
For line 1117:
Replace:#respond { border-top: 1px solid #e7e7e7; margin: 24px 0; overflow: hidden; position: relative; }
by:
#respond { padding: 0 20px; border: 1px solid #e7e7e7; margin: 24px 0; overflow: hidden; position: relative; }
For line 568:
Replace:#content tr td { border-top: 1px solid #e7e7e7; padding: 6px 24px; }
by:
#content tr td { border-top: 1px solid #e7e7e7; padding: 6px 0px; }
But when you do this last replacement (for reducing the space between video and chat) you also have to modify the file where these objects (iframes) are included. There you have to do this:
For the iframe of the video in the style attribute add
margin: 0 0 0 20px;
and in the style attribute of the iframe of the chat addmargin: 0 20px 0 0;
.This last part might be difficult if you don’t know html or css, so may be just leave the space between the video and the chat (then you also don’t have to do the replacement for line 568.
Forum: Themes and Templates
In reply to: [Whispy] Problem with 3 columns on post/static pagesSorry, didn’t know that. Replace:
#comments { clear: both; }
by:
#comments { clear: both; padding: 0 145px; /* Half the difference between 930 and 640 */ width: 640px; }
Cheers!
Forum: Themes and Templates
In reply to: [Whispy] Problem with 3 columns on post/static pagesTo resize the comment area adjust your Whispy style.css again, line 993 replace the old code by:
#comments { clear: both; padding: 0 145px; /* Half the difference between 930 and 640 */ width: 640px; }
Then you might also want to adjust the border line at the top of the comment section. I suggest the following: replace on line 1117
#respond { border-top: ...
by#respond { padding: 0 20px; border: ...
.
That makes sure the border is on every side of the comment area and adds a padding to keep the text away from the line.To make the spacing between the video and the chat you can do the following: in Whispy style.css change on line 568
padding: 6px 24px
topadding: 6px 0;
. Then where the iframes of the video and chat are created you also have to adjust some code. For the iframe of the video in the style attribute addmargin: 0 0 0 20px;
and in the style attribute of the iframe of the chat addmargin: 0 20px 0 0;
. That should do the trick!Forum: Themes and Templates
In reply to: [Whispy] Problem with 3 columns on post/static pagesI want the left sidebar to look identical to the right sidebar with having white space on both the left and right side of the left sidebar and with the items in it being centered.
This can be realised by the following code in your Whispy style.css:
On 112 replace the old code by:
#left-column { width: 220px; float: left; margin-left: 20px; }
On line 107 replace the old code by:
.three-column #content { margin: 0 auto; width: 460px; float: left; }
I don’t see any page with a live stream anymore is that correct?
To make the text in the left sidebar left aligned, remove this code:
text-align: center;
from style.css line 1246 with#left-column .widget-area ul ul li { ... }
.Let me know if you have more issues open.
Forum: Themes and Templates
In reply to: [Whispy] Problem with 3 columns on post/static pagesI’m not sure what exactly you would like to center, but you could try to add the following to your Whispy style.css:
.one-column #comments { text-align: center; }
I hope that solves your problem. I’m sorry, I don’t have much time this weekend.
Forum: Themes and Templates
In reply to: [Whispy] Problem with 3 columns on post/static pagesHi Sabrina, maybe you can use the following information. I confirm that the 3 column option is not working properly or at least not doing what I expect it to do.
I want for my own website to have on all pages 3 columns, not only on post pages. Also I can imagine that other people want 3 columns on every page, except for the home page. Or instead of 3 columns, you might want 2 columns. If one of these situations apply to you, read on.
To achieve this, several files have to be changed, but only simple changes. First open /root/wp-content/themes/whispy/header.php and at the end of the file add the code
<?php $whispyOptions = get_option('whispy_theme_settings' ); if ( $whispyOptions['colspost-post'] == '3' && !is_front_page() || $whispyOptions['colspost-index'] == '3' && is_front_page() ) { ?> <div id="container" class="three-column"> <?php get_template_part( 'sidebar', 'left' ); } else { ?> <div id="container"> <?php } ?>
Save the file and now repeat the following instruction for the files archive.php, author.php, category.php, index.php, page.php, search.php, single.php and tag.php in the directory /root/wp-content/themes/whispy/. In those files, delete the following code:
<div id="container">
.Now do the above instruction also for the file home.php (in the same directory) and also delete the following code:
$whispyOptions = get_option('whispy_theme_settings' ); if( $whispyOptions['colspost-index'] == '3' && is_home() ) get_template_part( 'threecolumn-page' ); else {
which was on top of the page and also delete the small character
}
at the bottom. Of course you saved all the files after modifying them and now upload them to your server. You can now use the setting ‘Posts index page layout’ to specify the number of columns on your home page and ‘Posts layout’ to specify the number of columns on all other pages. These settings you find when you log into your WordPress website, click the tab ‘Display’ (I hope this translation is correct) and then click on ‘Whispy options’.The perfectionist that I’m wants me to also rename the text ‘Posts index page layout’ and ‘Posts layout’, so here are the instructions. Open the file whispy_theme_menu.php in the same directory as the other files mentioned above are in and adjust line 66 and 77 to whatever you like!
As far as the alignment of widgets I did not check yet, but I might do so when I run into problems myself.
Have a nice weekend!
Ow by the way, note that when you make adjustments to the theme that these adjustments will be overwritten (gone) when you update the theme files!
Forum: Themes and Templates
In reply to: [Whispy] Cant show 3 columnsI just downloaded the latest version of the Whispy theme and I can confirm this problem.
Here is the solution (for the homepage only!).
in the directory wp-content/themes/whispy, find and open the file page.php. Add the following code directly after the php opening tag ‘<?php’:$whispyOptions = get_option('whispy_theme_settings' ); if( $whispyOptions['colspost-index'] == '3' && is_front_page() ) get_template_part( 'threecolumn-page' ); else {
Now, in the same file, add directly after the php closing tag ‘?>’ the following code:
}
Safe the file and your homepage should show 3 columns when this is set in the theme options. Cheers!
Forum: Plugins
In reply to: [Media Library Categories] Call to undefined function cleanQuery()No worries, thanks for the fix!