New answers tagged

0

archive.php is very broad template, possibly used for many kinds of archives. If you mean common reverse chronological view the link to that would be return of get_post_type_archive_link() for the specific post type. Note that the native post post type is special case. For it archive is typically either site root or posts page, depending on site's ...


0

The URL for archive.php to list all posts which do not have a category assigned is: http://example.com/uncategorized/ This can be found be going to any post which has not been assigned a category, and examining the URL. Just remove the post slug to arrive at the relevant archive: http://local.example.com/uncategorized/hello-world/


2

Paging a list of terms/categories/tags are quite easy, and to achieve that, you need minimal info. Lets look at we need the amount of terms the amount of terms per page get_terms() (Just note, the usage of get_terms() have changed in version 4.5). You can also use get_categories() if you wish, get_categories() is just a wrapper function for get_terms() ...


1

I'm not familiar with WP-PageNavi, but I suspect it assumes to be dealing with posts, so it might easily screw up if you use it on a loop like yours. Perhaps the css might still be helpful in styling your html. Anyway, setting up your own pagination is not that difficult. First, you need to know how many categories there are: $cat_amounts=count($cats); ...


0

You could have saved yourself a ton of work and just used the Co-Authors Plus plugin. It has a guest author function. You do have to set them up, but there is no account/password for them, and they can have author pages. (I am not affiliated with them, just use it on several sites.)


1

thanks to @TheDeadMedic, I found the solution. I used reserved terms, and that's why Wordpress interpreted my inputs as query parameters. so for example with my categorys, I had to change my classes in my form : 'post_category' => array($_POST['cat']), // Usable for custom taxonomies too by 'post_category' => array($_POST['my_cat']), // ...


0

I know nothing about the theme or plugins you are using. Since your theme isn't responsive you could get away with the down and dirty approach if you can edit CSS files: /wp-content/themes/mytable/style.css line 262 .content-bar { border-right: none; width: 890px; } /wp-content/themes/mytable/style.css line 181 .right-sidebar { display: none; } Or ...


2

Notes: Currently you're echo-ing the output of wp_get_archives(). In order to return it, we must set the echo input parameter to false. You're assuming the output of wp_get_archives() is an array, but it's a string. Workaround: Here's one way, by counting the <li> instances, with the html format: $args = [ 'parent' => 0, 'hide_empty' ...


4

In regards to your decision not to use WP_Query, pre_get_posts is actually an excellent choice to make, rather than creating a new instance of WP_Query. In fact, pre_get_posts is exactly what you should be using when you want to change the main query. Rather than executing a separate query on each page load, it modifies the main query's parameters before it ...



Top 50 recent answers are included