Home > Software design >  How to modify the text of a wordpress page from the source file
How to modify the text of a wordpress page from the source file

Time:01-01

i would like to know how i can edit a text on a page of my wordpress theme directly from the source file ... i would like to know how to target the source code and file responsible for displaying an element ... how To do? Is there a plugin for that?

CodePudding user response:

You can access the PHP and CSS WordPress source code files through the Appearance Editor then navigate to the theme editor. Find the file you want and make the necessary changes. Make sure you get a backup beforehand.

CodePudding user response:

your theme's files are settled in the wp-contents/theme/your-theme-name and here is where you must search for your desired content in most cases. but also there are some cases that your target content generates by a plugin and is used in the theme, some shortcodes can be generated and used by such an approach, so for changing them u need to get that plugin and this is not a very straightforward task, I will tell u what u can do later. in some times, your target can be generated by javascript, for getting them u need to read the codes too.

let remain in the most probable location of your target script, THE THEME DIRECTORY, where you can edit in theme editor. for finding the partition u are searching about in the theme directory you can check out the theme structure hierarchy :

enter image description here

as you can see, you have some files in this directory that u can guess what files are about what corresponding content. for example: if your target is on the home page, it can be on the index.php or home.php , if your target is in the search result page, you can find it in search.php , if is not found page, find it in 404.php , it is in single post or page, search for it in single.php or page.php , if it is aggregated post or product page, search category.php and ...

yet you need to review the codes inside files, if these solutions is not proper to you, there is 1 way your can find your files, whether in plugin, js, or themes. but you need to FTP access or access to Cpanel/DirectAdmin area for that :
download all projects files, install phpstorm JetBrains (or other IDEs), let it indexing accomplished, press cntl shift f, search for your desired word in all projects. it will find your target for you. -be careful that your target word does not be reads from DB -.

  • Related