gs_s
Forum Replies Created
-
Forum: Plugins
In reply to: [Custom Login] [Plugin: Custom Login] custom login feature suggestionStill when javascript is off, the bar appears.
Forum: Plugins
In reply to: [Custom Login] [Plugin: Custom Login] custom login feature suggestionI mean the entire “gray bar” which displays that message. Is it possible to remove it?
Forum: Plugins
In reply to: [Custom Login] [Plugin: Custom Login] custom login feature suggestionI’m talking about this. screenshot
Forum: Developing with WordPress
In reply to: how to delete change admin footer textWith the above posted methods, still WordPress version number gets inserted in the footer. Does anybody know how to completely remove it?
Forum: Themes and Templates
In reply to: Remove Padding and Margin of All Elements insideOK, about the problem #2, removing this part eliminated the extra paddings.
#content tr td { border-top: 1px solid #e7e7e7; padding: 6px 24px; }
However, since this is for a plugin, I’m looking for a way to override that part rather than the user has to edit the theme. I mean the user should not have to change the exestent code but just add extra lines in the buttom of the file.
So, I tried this way,
The plugin converts
<code>$codelines</code>
to this<pre class="code"> <table class="code"> <tr> <td> <table class="codenum"> <tr><td>$codenum</td></tr> </table> </td> <td> <table class="codeline"> <tr><td>$codeline</td></tr> </table> </td> </tr> </table> </pre>
Then I added the css code like this.
.code pre { line-height: 20px; padding:0px 0px 0px 0px; } .code table tr td { padding:0px 0px 0px 0px; } .codenum table tr td { padding:0px 0px 0px 0px; } .codeline table tr td { padding:0px 0px 0px 0px; }
But it doesn’t override the current theme’s padding.
Forum: Fixing WordPress
In reply to: PagesThis video tutorial may help.
Forum: Fixing WordPress
In reply to: Switching Navigation MenuThanks, Michael!
'orderby' => 'title'
just did the job. I cannot believe I could have done this far. I really appreciate it. This is gonna be the last question hopefully.Now I’m trying to indent the subcategories looking like this,
Category 1
— Page D
— Page E
— Page F
— Category 3
—- Page C
—- Page G
—- Page H
Category 2
— Page A
— Page B
— Page Dget_category_parents()
seem to evaluate if the current category has a parent category or not. So, I insertedif (!get_category_parents($term->id, False)) echo "<ul>";
beforewhile ($my_query->have_posts()) : $my_query->the_post();
andif (!get_category_parents($term->id, False)) echo "</ul>";
after<?php the_title(); ?></a></li>
But I don’t see any changes in the actual web page. I also triedget_category_parents($term->name, False)
but it doesn’t work either. Do you see what I am missing?<ul> <?php //get categories then display all posts in each term $taxonomy = 'category'; // e.g. post_tag, category $param_type = 'category__in'; // e.g. tag__in, category__in $term_args=array( 'hide_empty' => false, 'orderby' => 'ID', 'order' => 'ASC' ); $terms = get_terms($taxonomy,$term_args); if ($terms) { foreach( $terms as $term ) { $args=array( 'orderby' => 'title', 'order' => 'ASC', "$param_type" => array($term->term_id), 'post_type' => 'page', 'post_status' => 'publish', 'posts_per_page' => -1, 'caller_get_posts'=> 1 ); $my_query = null; $my_query = new WP_Query($args); if( $my_query->have_posts() ) { echo $term->name; if (!get_category_parents($term->id, False)) echo "<ul>"; while ($my_query->have_posts()) : $my_query->the_post(); ?> <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></li> <?php endwhile; if (!get_category_parents($term->id, False)) echo "</ul>"; } } } ?> </ul>
Forum: Fixing WordPress
In reply to: Switching Navigation MenuThanks, Michael!
(By the way my server has recovered. It seems my code did something wrong to the server. :))
Adding ‘order’ => ‘ASC’ worked almost perfectly. Still the pages with multiple categories do not get sorted by name.
Let’s say “page D” in the example below is assigned to Category1 and Caegory2 and it looks like this,
Category 1
— Page D (page ID 1)
— Page E (page ID 2)
— Page F (page ID 3)
Category 2
— Page D (page ID 1)
— Page A (page ID 4)
— Page B (page ID 5)
Category 3
— Page C (page ID 6)
— Page G (page ID 7)
— Page H (page ID 8)They seem to be soted by ID, so I added
'orderby' => 'name',
under$args=array(
but it didn’t work.foreach( $terms as $term ) { $args=array( 'orderby' => 'name',
The below code reverses the category order. So, I wonder this kind trick can be applied to the listed pages.
$terms = get_terms($taxonomy,$term_args); rsort($terms);
Forum: Fixing WordPress
In reply to: Switching Navigation MenuOMG, it works, Michael.
Also, just changing ‘orderby’ => ‘name’ to ‘orderby’ => ‘ID’ made it sort by id.
However, it seems the post(page) order is somehow reversed like this, (the category order is fine.)
Category A
— Page 3
— Page 2
— Page 1
Category B
— Page 5
— Page 4
Category C
— Page 2
— Page 7
— Page 6Also pages with multiple categories do not get sorted. in this example it is ‘Page 2’. I’d like to change it so that it looks like this,
Category A
— Page 1
— Page 2
— Page 3
Category B
— Page 4
— Page 5
Category C
— Page 2
— Page 6
— Page 7So in order to achieve this, I tried changing this part but with no luck.
$args=array( 'orderby' => 'name', 'order' => 'DESC', "$param_type" => array($term->term_id), 'post_type' => 'page', 'post_status' => 'publish', 'posts_per_page' => -1, 'caller_get_posts'=> 1 );
(I’m talking about the first block of code you wtote starting with //get categories. )
I also tried using
asort($my_query->have_posts() );
but the error message said $my_query->have_posts() is not an array. OK, so if I want to sort and reverse the order, It seems I have to put them into an array first. After that, I can reverse with php sort functions.The following code is what I got so far. After inserting this code, my web server stoped working. So I cannot test it anymore until it recovers. I hope my code is not responsible for the server down.
<ul> <?php //get categories then display all posts in each term $taxonomy = 'category'; // e.g. post_tag, category $param_type = 'category__in'; // e.g. tag__in, category__in $term_args=array( 'hide_empty' => false, 'orderby' => 'ID', 'order' => 'ASC' ); $terms = get_terms($taxonomy,$term_args); if ($terms) { foreach( $terms as $term ) { $args=array( "$param_type" => array($term->term_id), 'post_type' => 'page', 'post_status' => 'publish', 'posts_per_page' => -1, 'caller_get_posts'=> 1 ); $my_query = null; $my_query = new WP_Query($args); if( $my_query->have_posts() ) { echo $term->name; $i = 0; while ($my_query->have_posts()) : $my_query->the_post() { $permalink_array[$i] = the_permalink(); $title_att_array[$i] = the_title_attribute(); $the_title_array[$i] = the_title(); $i++; } while ($i) : ?> <li><a href="<?php echo $permalink_array[$i]; ?>" rel="bookmark" title="Permanent Link to <?php echo $title_att_array[$i]; ?>"><?php echo $the_title_array[$i]; ?></a></li> <?php $i--; endwhile; } } } ?> </ul>
Forum: Fixing WordPress
In reply to: Switching Navigation MenuWow, great!
It worked like a charm for the second code starting with “//alpha list of posts”. But the first code starting with “//get categories” only lists up the pages in the default category and other categories do not show up.
Is it possible to retrieve all the defined categories and their pages? And hopefully subcategories are indented like this,
Category A
— Page 7
— Page 8
— Category C
—- Page 3
—- Page 6
Category B
— Page 4I’m afraid I’m asking too much. I hope it doesn’t bother you.
Forum: Fixing WordPress
In reply to: Navigation Links for Page CategoryThanks for the interesting idea.
But in that case, I guess the visitors have to click twice to open the page they want, like clicking(once) the category on the sidebar and after loading the category listing page, clicking(twice as total) the page they want.
Rather, it is less stressful for the visitors to navigate pages just by single clicks. You know, my website isn’t so fast. ??
Forum: Fixing WordPress
In reply to: Switching Navigation MenuThanks MichaelH, for the reply.
Tabbed Widgets does exactly what I’ve been looking for except with javascript.
The example you wrote really gives me much understanding in depth of how I need to modify the theme. I really appreciate it. On the other hand, I need to list up WordPress pages, not blog posts. Currently I have assigned categories to the pages with a plugin called, Ninja Page Categories and Tags. Still I need more research on how I can retrieve those pages with specified categories.
I wonder if you have any ideas about it.
Forum: Fixing WordPress
In reply to: Navigation Links for Page CategoryThanks again.
About the first link you gave, it seems to only support in a post/page view not in a sidebar. I might be wrong. (need more research.)
About the second link, it also requires to assign a category to a page one by one manually in a different configuration page. I found it’s kind of pain to do it for hundreds of pages.
It’s kind of surprising that WordPress does not natively support a such feature.
Thanks for the information. I’ll keep trying to find a way.
Forum: Fixing WordPress
In reply to: Navigation Links for Page CategoryThank for the reply.
Although the example in the first post has only three categories and a few hands of pages, in my actual web site I have hundreds of pages, so it is not realistic to do it manually. Ideally, when I add a page with a specified category, it automatically adds the link under the category in the navigation link menu.
I’m looking for this kind of code, (sorry this is not the php syntax just showing my idea)
foreach((get_the_category()) as $category) { echo $category; // search pages with this category foreach((get_pages_in_this_category()) as $page) { echo $page; } }
Forum: Fixing WordPress
In reply to: Language Selection Page on the Domein Root and RedirectsI could resolve this issue by creating a static page via Settings -> General -> Reading -> Front page displays