OK, after reading Rarst post i went with the taxonomy term option.
It was very simple:
- Just after the register_taxonomy call, i added one line of code
wp_insert_term('Featured','filter');
being filter my taxonomy. - Then I modified the query in the template, adding the line
'filter' => 'Featured',
inside the args.
Now I only see the featured projects in the portfolio page, which was my main goal. Moreover, i can easily list the featured projects in the backend, as well as Quick-edit this option.
UPDATE:
As a side note, if you then wanted to list the categories without the Featured category:
- Exclude the term by id:
<?php $featured_term = get_term_by('name', 'Featured', 'filter');
$featured_id = $featured_term->term_id;
$args = array('taxonomy' => 'filter', 'exclude'=>$featured_id);
wp_list_categories($args);
?>
Related Posts:
- What is the preferred way to add custom javascript files to the site?
- How to add posts to custom menus?
- How to add custom css file in theme?
- How to remove search bar from a wordpress theme? [closed]
- How to: Update live sites theme from version control repo via plugin or library? [closed]
- Best practice way to implement custom sections into a WordPress theme
- Adding items to page template dropdown on Page Edit Screen
- How to customize wordpress login/register pages?
- Change text of twentyseventeen_edit_link()
- Page attribute template dropdown not displayed even the syntax is correct
- How to add a text widget during theme activation
- WordPress Theme customisation CSS
- When developing a distributable Theme, does it HAVE to be “inheritable”?
- Why does this loop only work on the homepage?
- Nesting Functions within Functions
- De-registering parent style sheet css recommended?
- inserting custom li class to wp_list_pages
- Theme check: Missing a text-domain
- Can I customize any WordPress parent block-based theme template files by child theme like a parent classic theme?
- How to determine if post has widget content?
- Custom Script Section Only Echoes Text
- Free starter theme to make mobile websites? [closed]
- Creating Theme Options Page
- How can I let templates choose which stylesheets are enqueued?
- WordPress Local Install Theme Folder Permission To Edit
- Lightweight framework [closed]
- Display div only on the HOMEPAGE
- WordPress is adding margins and padding to my custom menu?
- What is the best way to organize template parts?
- Keep sticky posts out of query unless they have featured image
- wp_enqueue_script outside functions.php file?
- How to implement a $_SESSION alternative in WordPress inside a theme without a plugin?
- How can I make my options in an array and store theme in WP options one DB row?
- Differences between developing custom themes for wordpress.com and wordpress.org?
- Easy to develop on a URL that is changed for production?
- Following Web Performance Optimization techniques to output static and dynamic css
- How to control on which pages the Aldehyde theme’s main slider is shown?
- Internal Stylesheet in WordPress Theme development
- How to support letting users add their OWN logo to a custom theme?
- WordPress stylesheet isn’t being added
- How to detect and display a page only for IE?
- Does code in function.php differ from theme to theme
- How can I optimize this code? [closed]
- Issue on Getting Custom post type Thumbnail’s URL
- Forms won’t submit
- Change image size depending on page
- How do I provide for multiple crops of the same image in a theme?
- How to include a mu-plugin as a theme dependency?
- Why WordPress AJAX returns undefined however it works fine when I add static url instead of dynamic function?
- How to use ajax in wordpress and sending the data without refreshing ?
- Adding an external link to product grid list pages for woocommerce
- Twenty Seventeen Pages Loop
- What and where are the WordPress core-bundled scripts?
- How to add pages in wordpress using codes?
- How does the loop know which post to view?
- How to remove permalinks links presents in each page of my site?
- How do I get from search_theme_directories() to the $stylesheet (name) for switch_theme()
- Tabbed theme options query about add_settings_section callback function
- Why my theme option not working?
- How to use multiple check-box values to work in a function and insert values in database
- How to make a function occurs for one time?
- How to know if I am on 1st page
- How to create a robust and logic class naming system in WordPress theme developing?
- How to enable admin to upload multiple images to support header carousel slider theme in WordPress?
- create loop for the_content()
- how to change footer content for certain pages only
- function ‘theme_settings_page’ not found
- I don’t know why categories are showing below post
- Should I use template files or just use conditional tags in index.php?
- Is there a way to create sections under “Colors” panel in the Theme Customizer?
- Need help with adding custom wordpress menu and sub-menu
- get currently showed author ID in theme functions.php
- WordPress Custom font not found
- How do I control the header space in non-front pages in Twenty Seventeen?
- Target second from last post in loop
- How to load mediaelement.js in theme template?
- WordPress Blog Page displaying nothing
- Full width thumbnail
- Customizer API way function is_customize_preview() works only in main page?
- Advantages/Disadvantages Using Theme Editor Instead of Pages
- Magnific Popup – Add Caption to Images
- Why do WordPress developers use so many opening and closing PHP tags when developing themes? [duplicate]
- using theme check plugin to remove waring and errors from my theme
- paragraph format in WYSIWYG on a custom theme?
- unable to display the image meta value as background
- editor style css and page template with and without sidebar
- 3 x 3 grid of posts on the home page
- Suppress the_content filter in a nested loop
- How can I change the title of the Home link in the navigation bar?
- The normal loop with different styles doesn’t work in search.php
- Pass custom css class to add_menu_page
- URL conflict with a ‘Single Page Layout’
- loading custom.js file after jquery is loaded
- How to force unlink on attached/inserted images?
- How to determine if it is legal to remove credit link from theme?
- Display recent posts on front page
- How to create sub-menu in “Allure Real Estate Theme for Placester”?
- How to make a multilingual wordpress site to be translated one-to-one without much effort and without using translate?
- Theme template file for a specific custom taxonomy
- How do I work with responsive images in WordPress? (img srcset/sizes)