How to make different urls for some tags pages
How to make different urls for some tags pages
How to make different urls for some tags pages
In case anyone else comes upon this question, I’m posting the solution I ended up going with for my “Recommended Links” plugin. I think it solves most of the problems I that I anticipated pretty well. For users who want to completely customize the output, give the option of using the default WP archive template. … Read more
It sounds like you’re looking for get_term_link( $term_ID ) which takes the term ID and returns a link. === EDIT: Try this: $term_id = get_query_var(‘tag_id’); $term_link = get_term_link( $term_id );
I’d use the default Links section in the dashboard, then write a custom loop to sort them alphabetically (and with the rad big letters of the alphabet as headings). Throw this in your theme’s functions.php file, then use it on any page with the [bookmarks] shortcode: function bookmarks_by_alphabet( ) { $letter=””; // For tracking which … Read more
You can hook into pre_get_posts and modify the query. Your hooked function will receive a WP_Query object as it’s only argument. You can check to see if you’re on a the correct post type archive and modify away. Something like this: <?php add_action(‘pre_get_posts’, ‘wpse63675_pre_posts’); function wpse63675_pre_posts($q) { if(!is_post_type_archive(‘your_album_type’)) return; $q->set(‘posts_per_page’, 20); // or however many … Read more
The main query that runs on archive pages are quite specific to archive pages, and this query is not replicated with a default custom query. As your code stands, your query will retrieve posts according to published date, ie from newest to oldest, and not according to archive. THE PROBLEM There are a couple of … Read more
You will have to define post order in second SQL query too. Try this one. // get years that have posts $years = $wpdb->get_results( “SELECT YEAR(post_date) AS year FROM wp_posts WHERE post_type=”post” AND post_status=”publish” GROUP BY year DESC” ); foreach ( $years as $year ) { // get posts for each year $posts_this_year = $wpdb->get_results( … Read more
As your links are generated by get_archives_link(), this is the place where you have to look. Doing so, by inspecting the source , you will notice that get_archives_link() – itself – doesn’t give you the possibility to add a CSS class to make the highlighting happen. There is of course the filter hook get_archives_link – … Read more
Create a new template named e.g. taxonomy-course_topic.php In my example course_topic is the name of the custom taxonomy you registered. First parameter of register_taxonomy() function. See: register_taxonomy Taxonomy template
I have this post and the response from David Chu to thank for enlightening me. There is nothing patently ‘wrong’ with the way that I implemented this. The reason that it doesn’t work is because of the fact that I have both the Genesis Simple Sidebars plugin and the Genesis Woocommerce Connect plugin installed. Both … Read more