mkjar
Forum Replies Created
-
Sorry after further testing – it seems like I am still having the same issues (I am not sure why I thought it was working)
the is the last dropdown on the page works but it seems to cancel out the earlier ones – also now if I do get the last drop down to work – it doesn’t allow me to use any normal links on the page – it seems to hold the ‘select’ value / address – am going to test it some more.
I think your original idea worked – I was trying earlier to set unique id’s but I didn’t think of resetting the script this is what is working now for me – I am going to test it some more:
<form action="<?php bloginfo('url'); ?>" method="get"> <?php wp_dropdown_categories('name=cat-2&id=cat-2&orderby=name&show_option_none=127 title&child_of=127'); ?> </form> <script type="text/javascript"><!-- var dropdown = document.getElementById("cat-2"); function onCatChange() { if ( dropdown.options[dropdown.selectedIndex].value > 0 ) { location.href = "<?php echo get_option('home'); ?>/?cat="+dropdown.options[dropdown.selectedIndex].value; }} dropdown.onchange = onCatChange; --></script> <form action="<?php bloginfo('url'); ?>" method="get"> <?php wp_dropdown_categories('name=cat-1&id=cat-1&orderby=name&show_option_none=Ingredients&child_of=126'); ?> </form> <script type="text/javascript"><!-- var dropdown = document.getElementById("cat-1"); function onCatChange() { if ( dropdown.options[dropdown.selectedIndex].value > 0 ) { location.href = "<?php echo get_option('home'); ?>/?cat="+dropdown.options[dropdown.selectedIndex].value; }} dropdown.onchange = onCatChange; --></script>
thanks for the help!!!
??
Thanks! – I am going to try what you suggested
Kust a little more explanation – what I am trying to accomplish is to make a category index with parent category drop downs in my sidebar template file – so that I can have each parent category and its sub-categories neatly and compactly displayed in the sidebar – instead of one super long category drop-down (which would be hard to use because there are so many categories) – it will be broken up into all the parent categories first
It would eventually look like this:BROWSE POSTS BY CATEGORY TYPES:
————————–
| PHOTOGRAPHY SUBJECT v |
————————–
| LOCATION v |
————————–
| RECIPE TYPE v |
————————–When I use the below options – the first drop down select works – but the ones following after don’t – they display the categories fine – but the links do not work –
<!-- for drop down select --> 126 <form action="<?php bloginfo('url'); ?>" method="get"> <?php wp_dropdown_categories('orderby=name&show_option_none=cat title &child_of=126'); ?> </form> 127 <form action="<?php bloginfo('url'); ?>" method="get"> <?php wp_dropdown_categories('orderby=name&show_option_none=cat title&child_of=127'); ?> </form> <script type="text/javascript"><!-- var dropdown = document.getElementById("cat"); function onCatChange() { if ( dropdown.options[dropdown.selectedIndex].value > 0 ) { location.href = "<?php echo get_option('home'); ?>/?cat="+dropdown.options[dropdown.selectedIndex].value; }} dropdown.onchange = onCatChange; --></script>
I’ve tried looking into both this: https://www.ads-software.com/support/topic/is-the-new-dropdown_categories-working?replies=13#post-657759
and
https://codex.www.ads-software.com/Function_Reference/wp_dropdown_categoriesForum: Plugins
In reply to: Sort Query Results by changing orderby – plugin?so I spent the day looking for some more options –
this one seems deprecated: https://www.ads-software.com/extend/plugins/wp-smart-sort/this one works well:
https://www.ads-software.com/extend/plugins/wp-snap/
https://www.nateomedia.com/wares/downloads/wordpress/wp-snap/but unfortunately it only sorts alphabetically by title…
any recommendations?
ok now I am trying to replace it with this:
<ul><?php $taxonomy = 'link_category'; $title = 'Link Category: '; $args =''; $terms = get_terms( $taxonomy, $args ); if ($terms) { foreach($terms as $term) { if ($term->count > 0) { echo '<li><a name="'. $term->name .'">' . $term->name . ' </a> <ul> <?php wp_get_links(title_before=<li>&title_after=</li>&category='. $term->name .'); ?> </ul> </li>'; } } } ?> </ul>
But the “&title_after=&category=Blogroll); ?> ” is rendering instead of the links underneath the categories.
Any Ideas???
Every post I see discussing this seems to be quite outdated – am I silly for trying to find a solution this way? I just want to be able to have my client be able to simply add links (which will be acting as community profiles) without having to manage a separate plug-in.
I realized I meant giving a ‘name field’ to the category instead of title.
below:<?php wp_list_bookmarks( 'orderby=name&order=ASC&limit=-1&show_description=1&category_before=<a name="HOW_DO_I_MAKE_THIS_WORK_category">&category_after=</a>&title_before= &title_after= ' ); ?>
but I still can’t make it work with the current code…
So I got a little further using some code I found today:
The code below makes the link categories into jump links (I am using it in my side bar) – now I just have to figure out how to make the category titles into anchors… in the code above…<ul><?php $taxonomy = 'link_category'; $title = 'Link Category: '; $args =''; $terms = get_terms( $taxonomy, $args ); if ($terms) { foreach($terms as $term) { if ($term->count > 0) { echo '<li><a href="#'. $term->name .'">' . $term->name . ' </a></li>'; } } } ?> </ul>
Forum: Fixing WordPress
In reply to: with a single page pulling the wrong comment formI ended up just removing the function – but i would like to figure out what happened so I wont do it again – any insights?
hmms – now it doesn’t produce any errors but doesn’t produce an image either…
That seems to produce Parse error: syntax error, unexpected ‘;’
Forum: Fixing WordPress
In reply to: Most Popular in one categoryit worked like a charm! thanks so much!
Forum: Fixing WordPress
In reply to: Most Popular in one categorythanks!
do you mean like this:
<?php $args = array( 'post_type' => 'attachment', 'numberposts' => 1, 'post_status' => null, 'post_parent' => $post->ID ); $attachments = get_posts($args); if ($attachments) { foreach ($attachments as $attachment) { echo apply_filters('the_title', $attachment->post_title); wp_get_attachment_link($attachment->ID, false); } } ?>
Because now that pulls up only the image title but not the image itself- am I missing somthing?
thanks!
Thanks!
I am still having problems with calling up the full image I am still only getting the thumbnail image. any hints?
‘<?php
$args = array(
‘post_type’ => ‘attachment’,
‘numberposts’ => 1,
‘post_status’ => null,
‘post_parent’ => $post->ID
);
$attachments = get_posts($args);
if ($attachments) {
foreach ($attachments as $attachment) {
echo apply_filters(‘the_title’, $attachment->post_title);
the_attachment_link($attachment->ID, false);
}
}?>
‘thanks again!