adieu
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [Hueman] Directing posts to different columnsI just tried this:
'cat' => hu_get_option('featured-category', '-16')
But it showed the page as if nothing was changed. 16, or News, appeared in the most recent post.
- This reply was modified 8 years, 5 months ago by adieu.
Forum: Themes and Templates
In reply to: [Hueman] Directing posts to different columnsI checked and unchecked the option, but nothing seems to change. I would rather not display the featured post in the list below, but I guess it’s not the end of the world if it does.
I wonder if I might have removed important code when I edited featured.php.
This is how it read:
$featured = new WP_Query( array( 'no_found_rows' => false, 'update_post_meta_cache' => false, 'update_post_term_cache' => false, 'ignore_sticky_posts' => 1, 'posts_per_page' => hu_get_option('featured-posts-count'), 'cat' => hu_get_option('featured-category') ) );
I changed it to:
$featured = new WP_Query( array( 'no_found_rows' => false, 'update_post_meta_cache' => false, 'update_post_term_cache' => false, 'ignore_sticky_posts' => 1, 'posts_per_page' => hu_get_option('featured-posts-count'), 'cat' => ('-16') ) );
Thinking I might have deleted important information in the editing, I tried a couple variations of:
'cat' => ('-16') hu_get_option('featured-category')
But my home page was wiped blank.
- This reply was modified 8 years, 5 months ago by adieu.
Forum: Themes and Templates
In reply to: [Hueman] Directing posts to different columnsHi bdbrown,
Not sure if it is what I have been doing or the settings I’ve changed, but now on my home page I have two copies of the most recent post.
But it only shows it posted once on my dashboard.
Any idea about that?
Forum: Themes and Templates
In reply to: [Hueman] Directing posts to different columnsWorks perfectly, bdbrown. Thanks. You’re the best.
Forum: Themes and Templates
In reply to: [Hueman] Directing posts to different columnsYes, last post means most recent…
I have six categories that I would like to appear in the featured posts, but maybe I could give them all one such as “cruising” or “featured”, and a second category to distinguish them.
I like the second option. I copied featured.php to my child theme. I would like to exclude all “news” category posts which will be 16 and have them appear in the second sidebar.
Admit that I am clueless about how to code that.
Googling tells me that I can add this to index.php
if ( is_home() ) { query_posts( 'cat=-3' ); }
to exclude posts, but I have copied index.php to my child theme and tried placing the code in a couple places. Nothing happened that I could see (using the numbers of a couple of my categories).
- This reply was modified 8 years, 5 months ago by adieu.
Forum: Themes and Templates
In reply to: [Hueman] Directing posts to different columnsThanks bdbrown. Feeling a bit foolish that I forgot the negative sign in all my attempts. It was right in front of me.
Is this what you mean?
function my_exclude_category( $query ) { if ( $query->is_home() && $query->is_main_query() ) { $query->set( 'cat', '-16' ); } } add_action( 'pre_get_posts', 'my_exclude_category' );
If I exclude posts such as ‘-14’ which is the ‘Puget Sound’ category, all the Puget Sound posts will disappear except the last post which is associated with the main photo and the excerpt.
Is there an easy way to block posts from appearing there as well? If not, maybe I could use a reorder plugin to each time shuffle a ‘News’ category post out of the last spot so it does not appear in the main content area, or does so only briefly. That make sense?
Your help is much appreciated. Have a good night. I am about to do the same.
Forum: Themes and Templates
In reply to: [Hueman] Directing posts to different columnsIf I place this in the functions.php file on my site:
function exclude_category( $query ) { if ( $query->is_home() && $query->is_main_query() ) { $query->set( 'cat', '6' ); } } add_action( 'pre_get_posts', 'exclude_category' );
Then only category ‘6’ posts appear in the main blog. All the other categories are excluded, except the last post that is associated with the main photograph. It remains. On my site, category ‘6’ is the “Georgia Strait and Sunshine Coast” category.
The category I would want to exclude is News, which is 16. I have not yet created any News posts. If I place
function exclude_category( $query ) { if ( $query->is_home() && $query->is_main_query() ) { $query->set( 'cat', '16' ); } } add_action( 'pre_get_posts', 'exclude_category' );
in functions.php, no posts appear in the main blog, except for the one associated with the main photo.
Any ideas what I am doing wrong?
Forum: Themes and Templates
In reply to: [Hueman] Directing posts to different columnsMaybe I’ve figured it out. I’ve get back to you either way. :-}
Forum: Themes and Templates
In reply to: [Hueman] Directing posts to different columnsHi bdbrown,
It easy enough to use the Hueman Posts widget to define a particular category. I have done that already with another category.
My problem is translating the code below.
function exclude_category( $query ) { if ( $query->is_home() && $query->is_main_query() ) { $query->set( 'cat', '-1,-1347' ); } } add_action( 'pre_get_posts', 'exclude_category' );
I don’t know how they have determined the category ID numbers 1 and 1347. I must be crazy, but have looked everywhere and not found any numbers to identify my categories.
- This reply was modified 8 years, 5 months ago by adieu.
Forum: Themes and Templates
In reply to: [Hueman] Directing posts to different columnsThanks tons, bdbrown.
The news posts will have the same category. I will read up on the link you gave me.
Cheers
Forum: Themes and Templates
In reply to: [Hueman] Changing the content area of a single pageI think that did it.
Much appreciated. You’re the best.
Will get back to you if the borders and shadows bother me.
Many thanks.
Forum: Themes and Templates
In reply to: [Hueman] Changing the content area of a single pageForum: Themes and Templates
In reply to: [Hueman] Changing the content area of a single pageThe problem is that if I create a sample page it seems to affect all other pages on the site. Is there a way to apply your instructions without it affecting other pages?
I select the full page view.
In Appearance/Edit CSS I place:
.container-inner {
max-width: 900px;
}and click “save stylesheet”.
I also tried to save your code in my child theme, but nothing happened ??
This is a screenshot of my homepage with your code.
Forum: Themes and Templates
In reply to: [Hueman] Changing the content area of a single pageThat’s interesting. I like the way yours works!
Tried it again. Same result as before
I will keep trying things. Maybe there is something I am doing wrong.
Thanks for your help.
Forum: Themes and Templates
In reply to: [Hueman] Changing the content area of a single pageHi bdbrown,
It doesn’t seem to work.
Pages without columns view correctly, except there are gray boxes where the (removed) sidebars would appear if there were sidebars.
Pages will sidebars are squeezed down so the whole page is 900px wide. The content area is a skinny column down the middle.
Thanks for the help.