I am in the process of heavily customising a WordPress theme. The theme is quite complex so it is hard for me to identify how and where data is rendered from all the different files in the theme.
Is there a plugin for a browser which tells me what file in the theme a specific element is generated from?
please have a look at these plugins.
It will definitely help you.
[1] http://wordpress.org/extend/plugins/debug-bar/
[2] http://wordpress.org/plugins/debug-bar-template-trace/
Just install in your theme, and go to the page and trace it through this plugin, it will show you, from which file's code is executing right now...
Thanks.
The thing you'll find most useful, or at least the thing I've always found most useful, is the Wordpress template hierarchy.
It's a graphic that shows which files Wordpress will attempt to find to render a page of the site, for instance when showing a page, rather than a post, wordpress looks for a file called page-{id}.php (where {id} is the numerical id of the page) first, then page-{slug}.php, then page.php then index.php.
Using the hierarchy flow diagram, you can see which files Wordpress would try and in what order, and by comparing this to the files in your theme, you can quickly track down which file it is.
http://codex.wordpress.org/Template_Hierarchy - Scroll down to the image, it's the most useful bit.
Related
I tried researching it but do not find a direct answer I am trying to move a kentico cms website to wordpress but would like to know if it is possible to copy the kentico theme design to then place it within my new wordpress website?
Thank you all feedback and suggestions welcomed.
Not without manually changing some parts around and adding the WordPress related functions, no.
While you'll probably be able to copy your CSS file, you will have to do the basic WP theme work, e.g. adding the informational comment to your style.css, make sure your header and footer call wp_head() and wp_footer(), add the functions to work with the loop to output content etc.
You can find lots of detailed documentation on creating themes in the codex.
I try to modify a theme in WP and I just noticed that modifying a template part doesn't do anything. How is that possible? Tried on different browser to check if its cached and its not, how do I modify a theme part?
I'm using Academia Theme with LearnPress Plugin. I've made a Child theme and I'm trying to modify a file that is a theme part called content-course_list.php which is exactly the html that appears in the segment I want to modify. I just try to change a simple text that is "Read more". I found it, changed it and it doesn't update. I even put it in the child theme folder to make sure it gets it from there and nothing..
I don't use any cache plugins and the host is local (xampp).
It seems the theme has a "core" plugin (academia-core) as well, where its using some shortcode templates for parts of the website. I managed to find the text by its css class (found with chrome inspect in the page) while I searched in all the php files from theme and plugins. I hope this answer helps someone in the future.
I am trying to edit a WordPress site. When I try to edit the x.com/blog/ page nothing happens.
I am trying to find out which PHP files are related to set up the blog page, but I do not know how.
If I can find the right files I can edit those. So how can I edit the /blog page in Wordpress?
Open Admin Dashboard and edit page blog page and check which template is currently using for that page.Then go to "/wp-content/themes/[your-theme-name]/" and find that template.
https://developer.wordpress.org/themes/template-files-section/page-template-files/
Alternative you can check if x.com/blog/ is coming from archive page which is custom post type page. You can find it via go to "/wp-content/themes/[your-theme-name]/archive-blog.php"
https://codex.wordpress.org/Post_Type_Templates
Go to /wp-content/themes/[your-theme-name]/. All files which are responsible for rendering the output can be found there.
Most likely index.php, home.php, front-page.php or page.php are responsible. The exact responsibility depends on the structure of the used theme.
Simple drop a
echo "This file is used currently.";
into the top of those themes and check if this appears in the source code if you are reloading the page.
Also make sure that any caching plugins are temporarily deactivated.
The basics on how WordPress themes are made and which template part is called can be found here: https://codex.wordpress.org/Theme_Development
Okay so my problem is that, I am currently working on a website which is already been created using wordpress. My problem is that when you see the website page, there is all the data and everything is present. But when I come to the backend of the page in wordpress its not showing any content at all. I mean its like there has never been the data at all in this page. Its so confusing. Please answer me this. And kindly remember that I am not a good coder so anything that is related to coding please ellaborate it with examples.
I 've fixed it.
The problem is in charset of db.
Open wp-config.php file and just change charset to utf8 & comment the old one.
define('DB_CHARSET', 'utf8');
Thanks
Like the other commenters mentioned, you can also insert content into pages on Wordpress with pages on custom themes.
Remember to back up your site before you make any changes.
Try to change your theme by going to 'Appearance->Themes' in the Wordpress admin window and activating a new theme. Head to the page in question and see if the content is still there. If it isn't, it's being added in a custom theme, which is probably what's happening.
If that's all you need to know, you're all set - otherwise, you can use this process to find what's creating the content:
Go to your Wordpress installation directory (you'll know you're there when you see folders like 'wp-admin' and 'wp-content'), then go to 'wp-content->themes' and see what themes you have installed. You can dig around in the php files there to find the content being created. You'll need to play around with PHP if you want to learn more from there.
I have a problem: I built a website with only raw code, and now I want to switch to a content management system like wordpress. I’d like to know how can I just upload all my code (html, css and javascript) without screwing up with the code on wordpress especially with php. Maybe do I need to find a blank theme, and for blank I mean a blank page. Any suggestion?
It depends on what you have. You should start with blank template and do part of the job, other part is to fill the content - it is possible to put there php by some plugins but it is not secure.
here you have template:
http://html5blank.com
Marco if you want to just migrate the site into wordpress and don't want to use wordpress to process any data and display it for you then migration is not difficult.
just start with any blank site ( I would start with underscores available at http://underscores.me/ ) and then just keep the index.php, functions.php and style.css to start with and then add components as and when required.
actually functions.php is not mandatory to get your WP site up and running but you can enqueue your JS and CSS files here
the topic is a very detailed one but if you need further assistance then do lemme know
I will strongly advise you to read Theme Handbook on Wordpress.org site
Hope this helps
Take care and Happy coding