Daniel
Forum Replies Created
-
Forum: Plugins
In reply to: [mqTranslate] mqTranslate and Qtranslate SlugJust curious if this issue has been actually “resolved?”
I’ve like to switch over to mqTranslate but all our websites use Qtranslate Slug and my boss is going to kill me if anything breaks. Many directory sites link back to us via specific links and it’s important we keep the structure.
To be clear, it was said we can modify qtranslate-slug.php by replacing line 261 with this:
return ( version_compare($wp_version, "3.3", "<" ) || (!is_plugin_active('qtranslate/qtranslate.php') && !is_plugin_active('mqtranslate/mqtranslate.php')) );
and adding this after line 678:
if ($GLOBALS['q_config']['url_mode'] == QT_URL_PATH) $req_uri = preg_replace("/^{$GLOBALS['q_config']['language']}(\/|$)/", '', $req_uri);
Will my slugs work the same by doing this? Having read n4than’s post I’m assuming it’s no. ??
N4than, have you had any progress with this?
chsxf, I understand it’s not your responsibility to account for other plugins, but I have to admit this is an important feature! Like you said, it’s been long since there’s been any activity with Qtranslate Slug and I don’t foresee any in the near future… Like Dr. Phil says, “The best predictor of future behavior is past behaviour!”
That said, we’re at your mercy! ?? Do you foresee any of the following…
- Integrating seamless compatibility with Qtranslate Slug?
- Implementing a feature in mqTranslate that handles slugs?
- Perhaps creating a second child plugin, um you could call it “mqTranslateSlug”? ??
Just trying to get a grasp on whether or not I should continue looking in this direction as an alternate to Qtranslate as the slugs are an important factor to us!
Thanks! ??
Forum: Fixing WordPress
In reply to: Display text based on category of custom postHeck! You just don’t stop giving, do you?! ??
I’m glad you shared this as an alternate solution! This would be a great option if the client is the one doing the editing allowing them to easily include additional category information in a separate area!
Great share! Thanks again keesiemeijer! ??
Forum: Fixing WordPress
In reply to: Display text based on category of custom postHA HA!!!!! keesiemeijer, you freekin’ GENIUS!!! It worked!!!!
I REALLY appreciate your persistence!!!! If you ever find yourself in Cornwall, the first 10 beers are on me!!! ??
Thank you! Thank you! Thank you!!!!!!! ??
Forum: Fixing WordPress
In reply to: Display text based on category of custom postGood idea, it’s just that I’ve already utilized the description for just that…
I was going to include this information to the bottom of the post like so…
Menu Item Title
————————
Description of menu item set in the category description.- Item 1
- Item 2
- Item 3
[LOGO] A portion of all meals will go to the Montreal Children’s Hospital Foundation.
I guess I may have to reconsider and put it at the top! ??
Thanks so much keesiemeijer for all your help! ??
Forum: Fixing WordPress
In reply to: Display text based on category of custom postHey keesiemeijer,
WTG!!! Your query now works!!!! And I must say, it looks a hell of a lot cleaner than the mess I has going before!!!!
My original problem remains however in regards to this part:
<?php if (in_category('kids-menu') && ( $post->post_type == 'menu' ) ) : ?> <p>A portion of all meals will go to the Montreal Children's Hospital Foundation.</p> <?php endif; ?>
By removing the conditional tags, the text appears on all the menu categories!
Forum: Fixing WordPress
In reply to: Display text based on category of custom postI tried it again removing the conditional tag I was trying to implement… Here it is:
<?php get_header(); ?> <div id="container-sidebar"><!-- sidebar content container --> <h2 class="header-underline"><?php _e(single_cat_title()); ?></h2> <div class="menu-description"><?php _e(category_description()); ?></div> <?php $args = array( 'posts_per_page' => -1, 'meta_key' => 'menuoption_menu_pricing', 'orderby' => 'meta_value_num', 'order' => 'ASC', 'post_type' => 'menu', ); $all_args = array_merge( $wp_query->query_vars, $args ); $menuloop = new WP_Query( $all_args ); ?> <?php if ( have_posts() ) : while ( $menuloop->have_posts() ) : $menuloop->the_post(); ?> <ul class="menu-items"> <li> <div class="grid2column"> <?php the_title(); ?> </div> <div class="grid2column lastcolumn"> <?php if(get_post_meta($post->ID, 'menuoption_menu_pricing', true)): ?> <?php echo get_post_meta($post->ID, 'menuoption_menu_pricing', true) ?> <?php endif; ?> </div> <div class="clearfix"></div> <div class="item-description-menu"><?php echo get_the_excerpt(); ?></div> </li> </ul> <?php endwhile; ?> <?php endif; ?> <!-- *** NEED HELP HERE!!! *** --> <p>A portion of all meals will go to the Montreal Children's Hospital Foundation.</p> <!-- ************************* --> <div class="clearfix"></div> </div><!-- close #container-sidebar --> <?php get_sidebar( 'menu' ); ?> <?php get_footer(); ?>
And this is what is spits out:
WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘-1’ at line 1]?SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) INNER JOIN wp_term_relationships AS tt1 ON (wp_posts.ID = tt1.object_id) INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (33) AND tt1.term_taxonomy_id IN (33) ) AND wp_posts.post_type = ‘menu’ AND (wp_posts.post_status = ‘publish’ OR wp_posts.post_status = ‘private’) AND (wp_postmeta.meta_key = ‘menuoption_menu_pricing’ ) GROUP BY wp_posts.ID ORDER BY wp_postmeta.meta_value+0 ASC LIMIT 0, -1
A portion of all meals will go to the Montreal Children’s Hospital Foundation.I really feel that I need a conditional tag as there are other items:
- Starters
- Salads
- Traditional Style Chicken
- Portuguese Style Chicken
- Mains
- Sandwiches
- Sides
- Kid’s Menu
- Desserts
- Wines
I really don’t want to waste too much of your time as I thought the solution would be a more obvious one… But I think there’s a lot more pieces in play which complicates it a little more. I may just approach the developer of the theme and contract out his services.
What do you think? ??
Forum: Fixing WordPress
In reply to: Display text based on category of custom postGosh! No need for apologies.. LOL! I really appreciate your efforts!!!
Unfortunately, I get an error:
Notice: Undefined variable: menuloop on line 28Which is:
<?php if ( have_posts() ) : while ( $menuloop->have_posts() ) : $menuloop->the_post(); ?>
Would it help if I PM’ed you a URL to the site?
Forum: Fixing WordPress
In reply to: Display text based on category of custom postI’m trying to customize an existing theme through reference, copy and paste, etc… I’m really not a php guy (though wish I was!) but I’m trying to learn! ??
I tried your query but it broke due to this line:
$all_args = array_merge( $wp_query->query_vars, $args );
I think “menu_type” is used in another template file for “Wines” which is likely why it’s queried the way it is.
I can get it work by using this:
if (is_archive('kids-menu'))
But it shows on all the menu pages!
Does that help?
The way it shows in the URL is:
https://www.restaurant.com/menu_type/kids-menu/I believe menu_type in the custom taxonomy and kids-menu is the category?
Thanks again, and please forgive my ignorance!
Forum: Fixing WordPress
In reply to: Display text based on category of custom postHey keeslemeijer! I think it’s getting there, thank you very much for your help!!! ??
I believe it’s in an archive template… Let me show you just to be clear! ??
File Name: taxonomy-menu_type.php
<?php get_header(); ?> <div id="container-sidebar"><!-- sidebar content container --> <h2 class="header-underline"><?php _e(single_cat_title()); ?></h2> <div class="menu-description"><?php _e(category_description()); ?></div> <?php $menuloop = new WP_Query(array( 'posts_per_page' => -1, 'meta_key' => 'menuoption_menu_pricing', 'orderby' => 'meta_value_num', 'order' => 'ASC', 'post_type' => 'menu', 'tax_query' => array( array( 'taxonomy' => 'menu_type', 'field' => 'slug', 'terms' => wp_get_post_terms($post->ID, 'menu_type', array("fields" => "slugs")) ) ) )); ?> <?php if ( have_posts() ) : while ( $menuloop->have_posts() ) : $menuloop->the_post(); ?> <ul class="menu-items"> <li> <div class="grid2column"> <?php the_title(); ?> </div> <div class="grid2column lastcolumn"> <?php if(get_post_meta($post->ID, 'menuoption_menu_pricing', true)): ?> <?php echo get_post_meta($post->ID, 'menuoption_menu_pricing', true) ?> <?php endif; ?> </div> <div class="clearfix"></div> <div class="item-description-menu"><?php echo get_the_excerpt(); ?></div> </li> </ul> <?php endwhile; ?> <?php endif; ?> *************************** PART I NEED HELP WITH!!!! *************************** <?php if (in_category('kids-menu') && ( $post->post_type == 'menu' ) ) : ?> <p>A portion of all meals will go to the Montreal Children’s Hospital Foundation.</p> <?php endif; ?> ********************************************************************************** <div class="clearfix"></div> </div><!-- close #container-sidebar --> <?php get_sidebar( 'menu' ); ?> <?php get_footer(); ?>
Forum: Fixing WordPress
In reply to: Display text based on category of custom postHey Andrew!!!
Thanks so much for taking the time to help a brother out! The feeling of community here gives me the “warm and fuzzies!” ??
Unfortunately, I tried it and it didn’t work… I was told by another source (who’s limited to the support he can give) that I was close, but it’s a custom post type, therefore I needed to specify the category of the custom post type.
I’m just not sure how to go about doing this!
Thanks again!
Forum: Plugins
In reply to: [Qtranslate Slug] Help! Notice: Undefined offset: 0I feel like such an idiot!!!! My fault for not reading the documentation properly!
Thank you so much for your time and prompt support!
You the man!!!!!!! ??
Forum: Plugins
In reply to: [Qtranslate Slug] Help! Notice: Undefined offset: 0Hi Carlos, I really appreciate your support! ??
Here’s what I used for the switcher:
<?php if ( function_exists( 'qtrans_generateLanguageSelectCode' ) ) qtrans_generateLanguageSelectCode( 'text' ); ?>
Forum: Plugins
In reply to: [Qtranslate Slug] Help! Notice: Undefined offset: 0Thanks Carlos! You ROCK!!!! ??
It works, however this update seams to be buggy (Unless of course it’s something i did!)
Everything seems to work fine until I toggle from french to english…
For Example, when I’m on:
https://www.mywebsite.com/fr/menu-fr/entrees/Then click “EN” to view it in English, it wants to direct me to:
https://www.mywebsite.com/menu-fr/entrees/ (without the /fr/ directing me to a 404 Page Not Found)When it should direct me to:
https://www.mywebsite.com/menu-en/starters/In addition to this, when you toggle languages (though the qTrqnslate Menu) on non-category pages, it seems to want to use the native slug rather than the one created by the plugin.
Any idea as to why this is happening? Should I start a new topic for this?
Thanks again Carlos! ??