0

Hope this is not too generic, but it is an actual problem for which I could not find much help online.

I have a website with a custom theme, and the author's page is specific enough that it is included in a child theme to that custom theme.

That author page is actually used for users of the website, for some reason. It includes normal user profile information, picture, name, password change form, email, etc.

The requirement now is to give the user the possibility to manage some custom alert information that I am including via a plugin. That alert information resides on database tables created specifically for that and thus should be queried separately.

Specifically, we are talking about cars here. The site lists cars and the plugin I am creating will query the listings according to criteria specified by the user.

Is there any other way to add that information other than directly modifying the current author.php file on the child theme?

Thanks

2
  • Does each user have different custom alert information? This sounds like an unusual use case; normally users manage info inside wp-admin users section, not in the front end, so you could move this to the built-in Users area and it would probably be more secure and easier to customize. Are their user pages protected so only authenticated users with the right permissions can see them?
    – WebElaine
    May 26, 2017 at 15:21
  • @WebElaine, thanks. Yes, the user specifies the criteria and he/she receives listings ( we are talking about cars here ) according to his/her wishes. The page slug for the user area is like mysite/author/usernicename. . As this is a third party theme, I am not free to move things that much around as you suggest. And yes, you need to be authenticated to access the author/user page.
    – BernardA
    May 26, 2017 at 15:46

1 Answer 1

1

There is nothing strange about author pages being used for "just" users, because both are just users in WordPress. The difference is only in their capabilities.

It sounds like you have a quite specific child theme in place, with elaborate user–centric functionality. Unfortunately that limits your customization options to those provided by developers of child theme. WordPress doesn't have child of a child themes.

Your likely options are:

  1. modify templates (and somehow track changes for updates)
  2. find appropriate hooks for output (or request upstream developers to create them)
  3. handle and inject your modifications completely with JS (you can get away without touching template, but might be insufficiently robust depending on your requirements)
4
  • thanks. Being specific, I need to retrieve custom data from the db, show it to the user and allow him/her to modify it. I believe that that excludes option 3. If that's correct, then I am left with small butchery (2) or big one (1), right?
    – BernardA
    May 26, 2017 at 15:55
  • Well, you probably still could do it with 3, depends on how proficient you are with JS and if JS approach is desirable at all. Hooks would be ideal, but it depends if child theme has any useful ones for the task.
    – Rarst
    May 26, 2017 at 15:59
  • Not proficient enough for that and it feels like over engineering to me. I am leaning towards adding sub author page like mysite/author/authornicename/?my_alerts=1 that will call a specific php script, without messing with the regular author page.
    – BernardA
    May 26, 2017 at 17:57
  • Does the child theme have any widget areas? If so, you could add the content there. Or, if you have an editor view for these custom posts, add your own shortcode using a custom plugin, then call the shortcode in the_content to display the custom info.
    – WebElaine
    May 30, 2017 at 14:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.