caugb
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Get page's parent's slug (post_name)function the_parent_slug() { global $post; if($post->post_parent == 0) return ''; $post_data = get_post($post->post_parent); return $post_data->post_name; }Forum: Fixing WordPress
In reply to: How to select a category AND all his child[please keep marking your code using the code button or backticks]
replace
<?php if ( in_category(’47’) ) { ?>
by
<?php
$subcat = get_categories(‘child_of=47’);
$ids = array(’47’);
foreach($subcat as $c) $ids[] = (string)$c->term_id;
if ( in_category($ids) ) { ?>>> it should work..
Forum: Fixing WordPress
In reply to: Find and Delete Post inside the Word PressThe search will look in post_title and post_content for the given terms… it should work.
Above the posts table, on left side you have some links that filter the posts that you see (All | Published | Drafts). Maybe it is a draft and you are displaying only published… ?
Forum: Fixing WordPress
In reply to: Next and previous links don't workget_the_title()gets the title of the current post… placed here it was only breaking your query.query_posts('cat=299&post_status=publish,future');Forum: Fixing WordPress
In reply to: When login, stay in the same pageYou can do it via ajax, using
wp_signon($_POST)– just include in your query the fields ‘user_login’, ‘user_password’ and ‘remember’.
So, if the ajax request return true, you can do (with javascript)location.reload();otherwise alert someting like ‘authentication failed’.Forum: Fixing WordPress
In reply to: How to select a category AND all his child$subcat = get_categories('child_of=5'); $ids = array('5'); foreach($subcat as $c) $ids[] = (string)$c->term_id; [...] if(in_category($ids)) ...Forum: Fixing WordPress
In reply to: Changing database name in wp-config$table_prefix = ‘wp_’;
the table prefix is equal in both databases?
Forum: Fixing WordPress
In reply to: Backend Redirecting Me to my Mirror Site's Backendthe database stores your posts and all the information about your site. Including the site URL. So, all your links are being constructed using the original URL…
You can create a new installation, export contents from the old site and import it to the new.
Using phpmyadmin export tool, you can edit the huge file in a text editor (wordpad) and replace all occurrences of the URL with the new URL – but some data are stored serialized. And it will break all stored arrays that contains the URL as part of one of their elements.
Forum: Fixing WordPress
In reply to: Custom post type list without a custom loopI know there are many topica here about it, but I solved the problem with this simple function:
// adapted from Simple Custom Post Type Archives function mss_rewrite_rules($wp_rewrite) { $post_type = get_post_type_object('product'); $type_slug = $post_type->rewrite['slug']; $new_rules = array( $type_slug.'/?$' => 'index.php?post_type=product', $type_slug.'/page/?([0-9]{1,})/?$' => 'index.php?post_type=product&paged='.$wp_rewrite->preg_index(1), $type_slug.'/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?post_type=product&feed='.$wp_rewrite->preg_index(1), $type_slug.'/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?post_type=product&feed='.$wp_rewrite->preg_index(1) ); $wp_rewrite->rules = array_merge($new_rules, $wp_rewrite->rules); } add_action('generate_rewrite_rules', 'mss_rewrite_rules' );But why it works in my local server (without this function) is still a mistery.
Forum: Fixing WordPress
In reply to: Custom post type list without a custom loopThank you, molnarm. The hope is dead, but now I kown what to do!
Forum: Fixing WordPress
In reply to: Custom post type list without a custom loopalready did that… with no changes
Forum: Fixing WordPress
In reply to: Custom post type list without a custom loopSorry, after paste I see that the code was with
‘rewrite’ => array(‘slug’ => ‘loja’, …Just to say that this is not an error, ok? ‘loja’ is store in portuguese and I translate just for ask for your help.
🙂Forum: Fixing WordPress
In reply to: Custom post type list without a custom loopOk, here is the function that includes the post type: http://wordpress.pastebin.com/C0LCzdMz
Forum: Fixing WordPress
In reply to: Google-loaded jQuery doesn't work in wp-adminwhat is wrong with the embeded jQuery?
Forum: Fixing WordPress
In reply to: Get Posts from Two Different Post Parents?$attachments = my_get_children(array(281, 190));