gulliver
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Trying to better-understand archives.Thanks.
I’ve tried to find a date.php template – TwentySixteen doesn’t seem to use one, and all I could find was https://codex.wordpress.org/User:Skippy/Date.php… which has some errors (easily fixed) and displays daily as a calendar rather than list.
I’ll work-through that template and try to understand it better, but even with it yearly archives still use the home.php template and the day links on the calendar deliver 404s – perhaps because my post permalinks don’t have date infO/
Forum: Fixing WordPress
In reply to: Category and archive urlsUPDATE…
Can this be further modified to remove ‘category’… so that category archives are at root-relative ‘/misc/’?Some of this is theoretical… for posts which are in category ‘misc’ an archive url of ‘notes/misc/’ is ok – but I’m thinking of a scenario where a page might also be in category ‘misc’ and so an url of ‘notes/misc/’ would be unsatisfactory, and should instead be a root-relative ‘/misc/’.
And I realise there’s potential issues with naming conflicts – as these mods seem to prevent the default WP behavior of adding a ‘-2’ in such instances.
Forum: Fixing WordPress
In reply to: Category and archive urlsThanks.
I didn’t realise it was a ‘with front’ thing – similar to CPTs.
And regarding use of a child theme – again, thanks. (I use my own custom theme anyway, so don’t have the upgrade issue to worry about.)
Forum: Fixing WordPress
In reply to: Edit SQL to remove categories and reset numberingThanks.
I’m sorry for my slow response… don’t seem to have received a notification.
Tomorrow I’ll dive into the database and apply your suggestion.Forum: Fixing WordPress
In reply to: CPT, category, URL path.Thanks.
You’ve confirmed what I thought might be an issue…
Category base is disabled because I don’t normally use categories – everything goes into a default ‘misc’.
But for one project I needed a CPT for an extra section of the site… so a CPT of ‘item’ publishes into a root-relative path of /magazine/item-name/, thus saving having to create a category of ‘magazine’.
But, in using a third-party script to enable such posts to be restricted to members, category-level protection was the easiest option and hence I created the otherwise redundant category of ‘magazine’ solely for this purpose.
Extra code auto-publishes all ‘item’ CPTs into that category, and removes category meta boxes from the compose/edit screens.
I could change the CPT path to avoid a conflict.
I think I’ve some other rewrite code buried in my functions which might affect what gets priority.
And I’m not sure whether I want to show a category archive, or do so with an appropriately coded normal page.Clearly, I should have thought more about this… but I so rarely use categories and CPTs that much of it is a mystery to me.
Probably a good time to add some archives/pages and see what happens.
Forum: Fixing WordPress
In reply to: Disable and remove registration option> There is probably…
This isn’t a third-party issue, but one of modifying a core function (user registration) of WP. Being able to remove option from settings will prevent inadvertent disabling/re-enabling.
Forum: Fixing WordPress
In reply to: Disable and remove registration option>Name of plugin/App? Where did you download it from?
It’s ‘aMember’.
Good app, which I’m happy to use.And with my described measures, whilst I can achieve what I need (stop users editing their profile info within WP, and redirect them to do it through aMember), it’s still be useful to remove any reference to it on the settings page. (And whilst I can hide the checkbox/enable with css, I can’t do similarly with the label for it.)
And, depending on what’s involved, ‘completely remove the option for registration’ may affect the behavior of aMember and so not be appropriate. But it’d at least be good to remove any reference to it on the settings page.
Forum: Fixing WordPress
In reply to: Disable and remove registration optionThanks.
I already have it removed from the login page.
And disabled in settings.
Plus, I use css to remove the checkbox option in settings (so that an inexperienced admin doesn’t inadvertently re-enable it).
Further, I’ve added an action to restrict direct access (by directly entering the url in a browser) to the profile page at profile.php.I’d just prefer to remove the option entirely.
The backstory to this is that I’m using WP with a third-party membership app. And it’s that app which creates and manages the WP users.
Forum: Fixing WordPress
In reply to: Use category, or custom taxonomy, for CPT?Thanks.
This initially caused a duplicate category issue, which I began to describe before realising the cause was that the code I use to auto-assign ‘item’ CPTs to ‘magazine’ category is probably creating the duplicates.
Removing it seems to sort the issue. So now I need to find a way to auto-assign without creating duplicate categories.
function assign_item_category_automatically($post_ID) { global $wpdb; if(!wp_is_post_revision($post_ID)) { wp_set_object_terms( $post_ID, 'magazine', 'category'); } } add_action('publish_item', 'assign_item_category_automatically');Forum: Fixing WordPress
In reply to: Use category, or custom taxonomy, for CPT?Thanks.
Having experimented, I think I understand this better – but there’s still some issue which puzzle me.
I can stop the normal/post categories metabox appearing on the edit screen for the ‘item’ cpt by not using:
'taxonomies' => array( 'post_tag', 'category' ).And I’ve added a taxonomy which adds a menu item and metabox for the ‘item’ cpt, using:
function build_taxonomies() { register_taxonomy( 'categories', 'item', array( 'hierarchical' => true, 'label' => 'Special Categories', 'query_var' => true, 'rewrite' => true ) ); }But if I then create a new category using that ‘item’ metabox, the category also appears in the metabox of normal posts. I guess I’m missing something which would stop this.
Forum: Fixing WordPress
In reply to: Use category, or custom taxonomy, for CPT?Thanks.
Yes, you’re right, and there’s other info which I should have mentioned…
I currently have the slug set as ‘magazine’, so the url path is /magazine/item-name/ and hence works as you suggest.
The reason for assigning a category is for use with a third-party membership script, for which assigning a category (magazine) to be protected is a better option than setting protection on individual pages.
By having a category of ‘magazine’, to which I can assign (currently done automatically) all ‘item’ posts, I’m thus still able to show an unprotected ‘teaser’ page (ordinary, not cpt, page) at an url of /magazine/.
Having initially struggled to comprehend CPTs, I’ve subsequently been lazy and not revisited to understand the whole taxonomy thing – hence my post… I don’t know if registering a taxonomy of ‘magazine’ will add such a check-box to the category metabox and whether it’ll be available for just CPTs or also ordinary posts.
I really should be more self-responsible and dive-in rather than hesitating.
Forum: Plugins
In reply to: [Post Connector] Extra divsThanks.
I’m ok to edit core files, and redo after update – but the pro version seems the sensible option (even though much of any API-stuff is a mystery to me).
Forum: Fixing WordPress
In reply to: List categories and descriptionsThanks.
I’ve since found a way to do it without a plugin.
Here’s the code for anyone who wants it.<?php $categories = get_categories('exclude=1&title_li='); foreach ($categories as $cat) { echo '<p><a href=\"'.$cat->category_nicename."\">".$cat->cat_name.'</a>'.': '.$cat->category_description."(".$cat->category_count.")</p>"; } ?>Use in a template file, and add your own html.
Forum: Themes and Templates
In reply to: [P2] categoriesI use this plugin: P2 New Post Categories.
Forum: Themes and Templates
In reply to: [P2] Add delete to front-end?Thanks.
I’ll read the links and experiment.