Nox
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Theme develope featured area best practicesI was wondering about that too a few days before. Sometimes, there are some blocking situations in the development, and I do not know how to go forward within this context.
Here’s my most recurring case, dynamic contents with short and defined length, that should be call on several page, at different positions depending on them.
https://image.ibb.co/hfODhy/schema.png
I presume CPT are still the best approach, but maybe I’m missing something …
- This reply was modified 6 years, 8 months ago by Nox.
Forum: Fixing WordPress
In reply to: Several Category TypesYes, you should take a look at custom taxonomies.
https://codex.www.ads-software.com/Custom_Taxonomies
You can set up your own code, however if you don’t want to develop, I think you will find some plugins to manage them easier.
- This reply was modified 6 years, 9 months ago by Nox.
Forum: Developing with WordPress
In reply to: Customizer textarea field doesn’t keep break linesThank you, indeed that is weird but this way works nice.
Forum: Developing with WordPress
In reply to: Customizer textarea field doesn’t keep break linesHi,
Thanks, unfortunately, it doesn’t change anything…
Forum: Fixing WordPress
In reply to: Change hard link in all post content ?Don’t know why I didn’t think about searching a plugin. Thank you.
Oh, my bad. Indeed, it works fine now.
Thank you for your help, it was not so hard finally, I just need to learn to read ! …
I thought about something like that, but I presume it will not work. EDIT : It doesn’t.
/* Plugin Name: CP from Departement Description: Set CP depending on departement Author: ProfNox */ add_action( 'save_post', 'add_postal_code', 10, 3 ); function add_postal_code( $post_ID, $post, $update ) { $departement = get_post_meta($post_ID, 'departement', true); if ($departement != null){ $terms = []; $all_cp = get_terms( array( 'taxonomy' => 'cp', 'hide_empty' => false, ) ); foreach($all_cp as $key => $value){ if (substr( $value->name, 0, 2 ) == $departement) array_push($terms, $value); } wp_set_object_terms($post_ID, $terms, 'cp'); } }
EDIT : got this error : Warning: trim() expects parameter 1 to be string, object given in C:\wamp\www\wordpress2\wp-includes\taxonomy.php on line 2238
I’m totally lost it’s only my second try on plugin development…