• In many instances WordPress adds text within functions – e.g. “View all posts in …” when displaying a category link. Seems to also be many threads asking where / how to remove this text … whether ‘title’ attribute text, displaying the site name, etc. etc. Often it can’t be changed without either editing core files (a no-no), or having the knowledge / skill to add filters etc.

    Wouldn’t it be good to have a single file containing all the text WordPress inserts? Better yet, have the contents of that file viewable and changeable via the Admin dashboard?

    Could probably be achieved through a plugin, but I suspect that would add yet more queries whenever a page was loaded. Much better – I think – for it to be a core function, so that every time ‘hard’ text is needed, the text itself isn’t coded but an instruction to look up in that central table what to use.

    A huge task, I expect, to apply retrospectively to everything that exists, but once the basics have been set up new additions can use that format and the necessary changes made whenever an existing function is updated.

Viewing 7 replies - 1 through 7 (of 7 total)
  • In many instances WordPress adds text within functions – e.g. “View all posts in …” when displaying a category link

    This is usually controlled by your theme – not WordPress core.

    Wouldn’t it be good to have a single file containing all the text WordPress inserts?

    You mean like the language file that is part of any theme tagged as translation-ready?

    Thread Starter Kevin4fm

    (@kevin4fm)

    Apologies for the extreme delay in acknowledging your response … was working on something else and completely lost track of time!

    The text which primarily prompted this suggestion is “View all posts in %s” which is coming from “/…/wp-include/category-template.php”, a WP core file. I can’t find the text – or an alternative to it – echoed in any theme file, and when I delete it from the core file, it disappears from the site – so I thought it reasonable to conclude it was ‘core’ not theme related.

    I’ll investigate the language file suggestion – perhaps it will ‘intercept’ the text and change it to something else. Haven’t had an awful lot of luck getting language files to work so far, but I guess I just need to try harder. Also, a bit worried it might be ‘theme’ specific … in other words when I work out how to do it there, if / when I change theme, this tweak will be lost and need to be re-entered for the new theme. If that’s the case it doesn’t seem much different (amount of work wise) to editing core files and re-editing each time I upgrade. Perhaps I just need a better understanding of how / where / when language files work!

    I’d class myself as a ‘somewhat gifted amateur’. I can usually eventually work out how to do something if I want it badly enough. My suggestion is as much to help those who don’t have the skills / time / mental OCD to dig around to achieve things and just want to ‘plug and play’.

    What theme are you using? Where did you download it from?

    Thread Starter Kevin4fm

    (@kevin4fm)

    Hi Esmi

    I’m using the Montezuma theme from the Atahualpa stable, which I downloaded via the “themes” link on my WordPress dashboard. The “Show all posts in %s” text was appearing as title text on the breadcrumbs links (example here … well, not an example really because I’ve now amended the core file so there’s no title text!) but disappeared when I deleted instances of it from the “/…/wp-include/category-template.php” file.

    I’ve also searched all the files relating to an offline version of the site using MS Expression, and this was the only one that came up with the words “Show all posts in”. That’s what led me to the conclusion the text was coming from WordPress rather than my theme.

    Thread Starter Kevin4fm

    (@kevin4fm)

    As an afterthought, I just reread my original post, and ascertion of “many instances”, and trying to square that with your belief that text is usually controlled by the theme. If you take the comments template as an example, isn’t there a WordPress ‘fallback’? i.e. if the theme doesn’t tell the software to say anything different then put “One comment on …”?

    Never, ever, edit WordPress core scripts. Editing core scripts can bring down your entire site and/or open security holes for hackers to use. This text will be controlled by your theme. Try posting on the theme’s dedicated forum: https://forum.bytesforall.com/
    You should get a faster & more informed response there.

    Thread Starter Kevin4fm

    (@kevin4fm)

    ?? I stand (sit, actually) suitably chastised! Haven’t edited core files before, and this one was just laziness on my part – easier to just delete the text than to work out how to do it properly. I’ll restore the original file and work out how to do it the correct way.

    Thanks for reminding me of the potential perils of taking liberties! ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Single file for WordPress text’ is closed to new replies.