neomatrix2
Forum Replies Created
-
Forum: Plugins
In reply to: [Secure Custom Fields] updates to custom fields values do not showi am experiencing the same issue, have you been able to resolve this??
Although it happens when my post is in draft and i try to republish it by editing the values but they just doesn’t seem to reflect on the page??Update:
i am using this code now , it works if i publish a new post but doesnt work for existing posts??? ….. it should run every time and check all the posts in the database and auto categorize the post but smhw its not
`add_action( ‘wp_insert_post’, ‘update_post_terms’ );
function update_post_terms( $post_id ) {
if ( $parent = wp_is_post_revision( $post_id ) )
$post_id = $parent;
$post = get_post( $post_id );
if ( $post->post_type != ‘post’ )
return;
$post_title = get_the_title();
if (stripos($post_title, ‘oranges’)!==false) {// add a category
$categories = wp_get_post_categories( $post_id );
$newcat = get_term_by( ‘name’, ‘oranges’, ‘category’ );
array_push( $categories, $newcat->term_id );
wp_set_post_categories( $post_id, $categories );
}
}`i know it will put a good load on my database even if i figure this out but i am looking for a way to do this like one instance every two hours or something like that, Please help!
i used ‘francisco’ as the keyword instead of ‘oranges’ up there in the code and cat id 8, to which i want to assign posts automatically
Forum: Fixing WordPress
In reply to: Custom Taxonomy Post Count Incorrect‘update_count_callback’ => ‘_update_post_term_count’ worked for me
problem is not just with trash, its counting the drafted posts, I run a job board and each of my job expire after 30 days , i cant just empty the drafts as it will throw 404 if someone land on an old post via Google or any other search engine indexed pages, i show job expired mssg on old posts which wont be the case if just delete the draft.
Forum: Fixing WordPress
In reply to: Custom Taxonomy Post Count Incorrect@mad_max, can you help me work this code, I figure yoursite_edited_term_taxonomy is the Update Count Callback function ,
if i register a taxonomy say like this and use your modified version of duffcub’s code:
register_taxonomy(
‘genre’,
array(‘post’),
array(
‘hierarchical’ => true,
‘labels’ => $labels,
‘show_ui’ => true,
‘query_var’ => true,
‘rewrite’ => array( ‘slug’ => ‘genre’ ),
‘update_count_callback’ => ‘yoursite_edited_term_taxonomy’
)But it dsnt seem to work
I have your code exactly like you provided in functions.php but it showing me incorrect count
Kindly help me resolve it!!
Same issue, I am also waiting for the patch, not much movement on the ticket #14084 and i dont know if there is any alternative, Someone help please!!
Forum: Plugins
In reply to: [Taxonomy Widget] [Plugin: Taxonomy Widget] Show Post Counts – Includes TrashSame issue, Custom Taxonomy post count incorrectly counting draft and trash posts, Tried below patch in #14084 ticket and next solution but still not resolved, Please someone help!!!
Here are the links to what i tried
https://core.trac.www.ads-software.com/ticket/14084
https://www.ads-software.com/support/topic/custom-taxonomy-post-count-incorrect
Forum: Fixing WordPress
In reply to: Draft posts being counted by wp_list_categoriesHi,
Has anyone able to figure out the solution yet, I found out this ticket which addresses the issue
Here is the link:
https://core.trac.www.ads-software.com/ticket/14084the patch in this ticket dsnt seem to work.
How do i count only published posts using wp_list_categories or is there any alternative..