carpenoctem
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Data model for job board (requesting feedback)Your solution sounds better indeed 🙂 But I’m grasping to understand how to make it work for my job board.
Consider this:
North America
–––Mexico
Latam
–––Mexico
South America
–––French Guiana
European Union
–––French Guiana
MENA
–––Egypt
–––Israel
Africa
–––Egypt
Asia
–––IsraelThe above are not exceptions. There are a lot of overlaps.
So, the issue is that I need various types of country groupings – geographical, political, business, economic. And I don’t see how they can be put in a single hierarchy.
Do I duplicate the countries somehow or is there a smarter solution?
Regarding Uzbekistan. It is part of Eastern Europe according to Wikipedia, but this can be challenged I guess 😅 Thanks for bringing this to my attention – I’m going to change it.
Forum: Developing with WordPress
In reply to: Data model for job board (requesting feedback)Thank you for the example!
I should have been more precise in what I wrote.
Take a look at this:
'Ukraine' => array('Worldwide', 'Europe', 'EMEA'), 'United Arab Emirates' => array('Worldwide', 'Asia', 'MENA', 'EMEA'), 'United Kingdom' => array('Worldwide', 'Europe', 'EMEA'), 'United States' => array('Worldwide', 'North America'), 'Uruguay' => array('Worldwide', 'South America', 'LATAM'), 'Uzbekistan' => array('Worldwide', 'Asia', 'EMEA', 'APAC'),A country can be in multiple independent groups of countries and I don’t think the hierarchy you proposed is doable.
Taking that into account, I have one last question. Would it be better for performance to have such an array in code (like above) or better to keep in DB as metadata of taxonomy term? 😅
Like that: Worldwide, North America (Metadata) –> United States (Taxonomy Term) –> Countries (Taxonomy) –> Jobs (Post type).
Ok, I figured it out. For anyone interested:
This is the snippet:
function iwpe01_get_company_id_by_name($company_name = '') { // If the input is empty, return nothing if(empty($company_name)) { return ''; } // Try to get the post by title $query = new WP_Query(array( 'title' => $company_name, 'post_type' => 'companies', 'post_status' => 'publish', 'posts_per_page' => 1 )); // If a post was found, return its ID if($query->have_posts()) { $query->the_post(); return get_the_ID(); } // If no post was found, return nothing return ''; }This is how you call it in ImportWP (change 2 to your column):
[iwpe01_get_company_id_by_name("{2}")]Forum: Developing with WordPress
In reply to: Data model for job board (requesting feedback)Hey man, thank you for the feedback. This is very helpful!
Regarding locations. A job can be restricted for example only to North America and UK, so I’m not sure if a hierarchical taxonomy makes sense here. A job available in UK doesn’t mean it is also available in whole Europe.
I’m thinking about categorizing every country in my code (e.g. UK = Worldwide, Europe, EMEA) and then matching the job seeker’s country with the appropriate posts (e.g. country taxonomy = UK or region taxonomy = Worldwide or region taxonomy = Europe or region taxonomy = EMEA).
Does this make sense?
On the topic of postmeta and performance. I won’t have more than a few thousand job offers, so I guess I shouldn’t worry much about that?
Thanks again for your help!
Forum: Plugins
In reply to: [Plugin: Custom Field Taxonomies] Help test version 1.5bStill not working (shows no posts).
Any ideas?
Well, it works the way it should work (relatively to the url), but I don’t think that’s good for me 🙁
When my url is http://example.com/music/page/3 it outputs http://example.com/music/page/3?artist=somebody
Is there a way to make it stick to the category, ignore the paging and output http://example.com/music?artist=somebody on every page?Forum: Plugins
In reply to: [Plugin: Custom Field Taxonomies] Help test version 1.5bIn 1.4 this worked fine http://example.com/music?artist=somebody
In 1.5b the same url shows all posts from the category (no filtering)Also, in 1.5b the url http://example.com/music?artistnew=somebody shows no posts (artistnew is the URL Key)
Thank you very much! Works great!
Forum: Plugins
In reply to: [Plugin: Custom Field Taxonomies] Help test version 1.5bThis:
<p>Test: <?php echo get_linked_meta(get_the_ID(), 'music') ?></p>results in:
Fatal error: Call to undefined method CFT_Core::is_defined() in template-tags.php on line 39
Forum: Fixing WordPress
In reply to: Customizing the feed for a specific categoryAny ideas?
Forum: Fixing WordPress
In reply to: wp_rss shows gremlinsForum: Fixing WordPress
In reply to: rss.php bad charsetThank you very much! Works like a charm!