GabrielCol
Forum Replies Created
-
Forum: Hacks
In reply to: $wp_rewrite and $wp_querynevermind, i was checking if it’s set by looking in to the $wp_query object, but seems like get_query_var() is getting the value ??
Forum: Hacks
In reply to: $wp_rewrite and $wp_queryHi Otto, thanks for the reply.
However this is not the problem, i check the var after the init…any other idea?
Forum: Fixing WordPress
In reply to: Hiding Horizontal Menu on Home PageThat’s right, it means “if is not home” ??
Forum: Fixing WordPress
In reply to: Permalinks don't work for pages AND postsDon’t add pages, add only /%postname%/
Forum: Fixing WordPress
In reply to: Limiting posts by $post->post_content<?php the_content(); ?> should do it if is about index file ??
Forum: Fixing WordPress
In reply to: Permalinks don't work for pages AND postsAdd /%postname%/ or /pages/%postname%/
WordPress must know what post to query
Forum: Fixing WordPress
In reply to: Adding New Field To Admin Post and DatabaseDon’t alter your database structure, when you will make an update everything will be lost.
Use metaboxes instead. Have a look here: https://www.re-cycledair.com/wordpress-3-custom-post-type-meta-box-tutorial
Forum: Fixing WordPress
In reply to: Passing parameter from one page to another pageThis might help:
https://www.wphardcore.com/2010/5-tips-for-using-ajax-in-wordpress/Forum: Fixing WordPress
In reply to: Hiding Horizontal Menu on Home PageTry this:
<?php if(!is_home()): ?> // your menu code here <?php endif; ?>
Forum: Fixing WordPress
In reply to: How to add a link to the top bar?Check maybe your theme has custom menus support (Appearance -> Menus). If it does, add your link in the menu from there.
Else, hardcode your wp theme(header.php file) or edit the theme to support custom menus.
Forum: Fixing WordPress
In reply to: moving functions?What is the exact function that you want to move? I can’t see the purpose here. If you think that the users that will user the theme will don’t have that function in their wp files, test if funtion exists and if not, define it.
if(!function_exists('the_functions_you_are_searching_for)) { fuinction the_functions_you_are_searching_for() { // the function stuff here } }
Well, I think the only option is to really query all your posts, and search for that combination, because wordpress stores custom values is postmeta table and in a serialized array format.
Saying you have 3 custom meta defined:
– ad_title
– ad_url
– ad_imageYou start by querying all the posts
$my_posts = $wpdb->get_results("SELECT id FROM $wpdb->posts'); // this will tell us if that data already exists $insert = 1; // now search for that posted values foreach($my_posts as $p) { if($insert == 0) break; // stop the foreach loop if we found the entry in the database $ad_title = get_post_meta($p->id, 'ad_title', true); $ad_url = get_post_meta($p->id, 'ad_url', true); $ad_image = get_post_meta($p->id, 'ad_image', true); // saying that you post the vars that user imputs, test if we found it in the database and change $insert to 0 if we do if(($_POST['ad_title'] == $ad_title) && ($_POST['ad_url'] == $ad_url) && ($_POST['ad_image'] == $ad_image )) { $insert = 0; } } if($insert == 1) { wp_insert_post(data you have collected); }
Forum: Fixing WordPress
In reply to: Navigation Menu – Featured Image Display…If you use custom menu, i think is possible using wp_nav_menu_args hook
Forum: Fixing WordPress
In reply to: Updated to 3.0.5; Now my site won't show up :Sworks fine to me ??
Forum: Fixing WordPress
In reply to: Multiple login methods: FB, Twitter, blogs – or registermaybe intensedebate is what you are looking for?