daricedotorg
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Second loop in sidebar on category page not workingYes, both parent and the child have several post assigned to them.
Forum: Fixing WordPress
In reply to: Second loop in sidebar on category page not workingI have narrowed the problem down to a database issue.
When I use this code:
<?php $this_cat = get_query_var('cat'); ?> <ul> <?php wp_list_categories('orderby=id&show_count=1&use_desc_for_title=0&child_of=' . $this_cat . ''); ?> </ul>
It works correct for all categories except for category named “Interview” which contains one child category.
I can’t figure what the problem could be. The data in wp_term_taxonomy seems correct. The child category has the right id corresponding to “interview” as parent id.
I even created a new category Interview and deleted the old one. The problem still persists.
Forum: Fixing WordPress
In reply to: Second loop in sidebar on category page not workingNo, it’s regular posts with their categories. Nothing out of the usual.
The main page is category.php, see https://pastebin.com/rCSP51B6
You’ll notice I have an if/else in place for assigning the sidebar. When viewing the “Interview” category(id=11) it should get the sidebar with code to get the posts of the child categories of “Interview”.
Like said, the code works fine when I add another category in this line
$descendants = get_categories(array('child_of' => 11));
category “Column”(id=69) for example does return results. So there is something off with category 11 and its child category 115Forum: Fixing WordPress
In reply to: Second loop in sidebar on category page not workingI zeroed in the problem to this line:
$descendants = get_categories(array('child_of' => 11));
It works fine when I try another category that has lots of children but it won’t work with category 11(Interview), it keeps returning an empty result. This category has one child and that child has 7 posts.
I tried adding both the parent and child category to these posts, but it still returns 0 result. So, I’m at lost why the code works just fine with other categories but not with the intended category.
Parent category is id 11 and has 57 posts, child category is id 115 and has 7 posts. In the future the parent category will get more children with each their own posts.
Forum: Fixing WordPress
In reply to: Second loop in sidebar on category page not workingShould have thought about trying count. It returns 0 even though “Interview” has 1 child category with several posts. Now I need to figure why it won’t get the child category.
The site isn’t really heavy traffic, around 1800 hits a day but I’ll look into making a function instead of file include, thanks for the tip.
Forum: Plugins
In reply to: lizamoon reference in jetpack twitter php fileThose two lines mentioned by post starter are comments made by the developers. That explains what and why the code below that comment does.
This code strips the lizamoon url from tweets to protect from malware you get by clicking on the lizamoon website link in a tweet.
This code effectively disables the link so no one can click on it and get infected with a malware.Apparently Wordfence only registered the lizamoon word and give off a warning.
Forum: Fixing WordPress
In reply to: Pagination on single.phpWeird…still same issue. Do I have to modify anything else in the settings and is the use of
previous_posts_link(); ?> • <?php next_posts_link();
correct?Forum: Fixing WordPress
In reply to: Pagination on single.phpI tried the following but still the same issue:
<?php if (have_posts()) : $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts(array('posts_per_page' => 5,'paged'=>$paged,)); while (have_posts()) : the_post(); ?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> <div class="date">{<?php the_time('l, j F, Y') ?>}</div></li> <?php endwhile; previous_posts_link(); ?> • <?php next_posts_link(); endif; ?> </ul>
Forum: Alpha/Beta/RC
In reply to: Uploads folder location from single to multiple sitesThat solved the problem, thanks.
Forum: Alpha/Beta/RC
In reply to: Remove Multiple Sites/Turn off NetworkThat was the solution!
Remove all lines concerning MU from config.php and go back to the default .htaccess file.
Forum: Alpha/Beta/RC
In reply to: Uploads folder location from single to multiple sitesThanks! I will try that.
Forum: Alpha/Beta/RC
In reply to: Uploads folder location from single to multiple sitesThanks, that was indeed the problem. Images uploaded after enabling MU do display in the Media Library. The ones uploaded before MU don’t, will have too look more into it.
But the images do show up in my posts now so that’s solved! Thanks again.Forum: Alpha/Beta/RC
In reply to: Uploads folder location from single to multiple sitesThe first URL does not work for me, the second one does.
I digged deeper in the settings and in Super Admin -> Sites -> Edit
The upload path is the way I want it:
/var/www/vhosts/mysite.org/httpdocs/wp-content/uploads
, but when uploading from the the “Posts” editor it still goes to ‘blogs.dir’.Also “Media Library” still has all images broken…so either wise I have a setting wrong or it is a bug in WP3.
Forum: Fixing WordPress
In reply to: shortcode output always appearing at top of page contentThanks! echo=0 does it indeed! And then putting put it in a variable first. Without variable it won’t work.
Working code:
function werklinks() { $list = wp_list_pages("title_li=&child_of=8d&depth=1&echo=0"); return $list; } add_shortcode('werk', 'werklinks'); ?>
Forum: Fixing WordPress
In reply to: shortcode output always appearing at top of page contentThanks @alchymyth but it needs to be a shortcode. It needs to be added in the content and using a php plugin is no an option. The website needs to be as dynamic and simple as possible for the client.
I’m thinking the error could lie in the fact that wp_list_pages() has an echo in it so that’s while when used inside a function for shortocde it will output before the content. Not sure tho…