floi13
Forum Replies Created
-
Forum: Plugins
In reply to: [Contact Form 7] Create radiobuttons with custom post typeHi Yordan,
Ah, I forgot to mention that, thanks for doing so #thumbsup
Forum: Plugins
In reply to: [Contact Form 7] Create radiobuttons with custom post typeSolved the issue by doing the following things. Maybe this helps someone who tries a similar thing.
1) add this code to my functions.php:
function dynamic_select_field_values ( $scanned_tag, $replace ) { if($scanned_tag['name'] != 'YOUR CF7 FIELDNAME HERE') return $scanned_tag; $rows = get_posts( array ( 'post_type' => 'YOUR CPT NAME HERE', 'numberposts' => -1, 'orderby' => 'title', 'order' => 'ASC' ) ); if(!$rows) return $scanned_tag; foreach($rows as $row) { $scanned_tag['raw_values'][] = $row->post_title . '|' . $row->post_title; } $pipes = new WPCF7_Pipes($scanned_tag['raw_values']); $scanned_tag['values'] = $pipes->collect_befores(); $scanned_tag['pipes'] = $pipes; return $scanned_tag; } add_filter( 'wpcf7_form_tag', 'dynamic_select_field_values', 10, 2);2) add an element with corresponding name in your CF7 form:
[radio YOUR CF7 FIELDNAME HERE use_label_element default:1]Forum: Developing with WordPress
In reply to: Generate pages from url params@bcworkz thanks for your reply.
Haven’t thought of terms; perhaps that’s the way to go for me. If I understand you right it could be something like
– I create a custom posttype
– I create a custom taxonomy for that posttypeI then create a template with a term field and if the id equals 12345, show the content related to that id.
Am I correct so far?
Forum: Developing with WordPress
In reply to: Display post taxonomy REST APIHi bcworkz,
You’re right; the plan b wasn’t something I wanted to do, it was more of an alternative.
Hmz, a separate request you say.. perhaps I’ll drop the whole api approach and just display all wanted data through standard WordPress loop.Owell, you learn and you try (=
- This reply was modified 7 years ago by floi13.
Forum: Developing with WordPress
In reply to: Display post taxonomy REST APIHi Anurag,
This doesn’t seem to do anything, except limit the result to 10 items (total is 16). Maybe a screenshot of the api result helps: https://bit.ly/2UGE5iH. The ‘work-api’ returns the ID of the chosen taxonomy.
As a plan B I could write some logic like ‘if ID is 6, taxonomy is abc’, but that’s not something I would like to do.Forum: Fixing WordPress
In reply to: ACF true/falseAfter some tinkering about, it looks like it has to do something with the default value.
When I uncheck all projects (set to false) and check only one project (set one to true), I get 3 times a ‘boolean:false’ back and one ‘boolean:true’.Seems correct so far…
But what if I want to use the default ‘true’ value?