I'm a pretty decent wordpress coder. Maybe I'm being stupid, but I can't work out how to edit the Divi blog module layout... basically the archive.php for the Divi theme - it doesn't seem to have one.
What I want to do is change the HTML of the blog when it added to the Divi page builder as a module... How do I go about editing the code for that?
(I've searched everywhere and they all talk about CSS changes, but I want to edit the HTML that is output as well).
Thanks!
EDIT: To clarify my question, I'm looking for specific help with DIVI. I have a good understanding of Wordpress, and know the usual hierarchy structure. My question for Divi is more to do with the blog module that you add to the Page Builder - that's the bit I want to edit the HTML output of.
All google searches (and stackoverflow!) point me to CSS changes only, but I want to edit the HTML output of that page builder (Which I'm guessing is using a shortcode)
Make a copy of the index.php file from the Divi parent theme
Paste the file into your child theme directory
Change the name of the file to archive.php
Modify the html/php as you need
That should work :)
There is usually a page (under pages in Wordpress) that has an "Archive" template. Check it out and edit that template.
You can check more about page templates (and maybe even creating your own, if you wish) here - https://www.elegantthemes.com/blog/resources/an-introduction-to-wordpress-page-templates
You can use Divi Builder for categories pages or custom categories pages.
You simply have to go in Divi > Theme Builder. Then, go into a new model, and select the archive page you need. Finally, you can add custom content within the builder into the header, body or footer. That content will be available in the archive pages you selected.
Related
I'm building a WordPress site using Elementor theme. I'm quite new to WordPress development.
I'm using a custom post type for a group of entities. I need to create a custom post template for these. I'm using the default Hello Elementor theme. I've created a child theme, so that I'm not making code changes to the base theme, in order to avoid issues when updating.
In the child theme, I've created a template for the custom post type, using the structure described in the documentation here, by creating a file called single-{entity name}.php. This works, as I can modify this file, and it'll affect the results rendered when I try and access one of these pages.
My problem is that the header and footer disappears and it seems to disregard everything from the parent theme. If I copy this single-{entity name}.php file into the parent file, it works just as expected with the header and footer showing.
I'm guessing there's some logic that intercepts the render in the parent theme and adds the header and footer, but I don't know how it actually works.
I'm not sure whether I should keep it in the parent theme to get this to work of if I should move it back to the child theme and then add some configuration in order to get the header/footer to show? If the last option is the recommended way, guideline on how to achieve this.
Goal is to be able to have a file that governs the template for all entities of this type, keep the header/footer and not be at risk of breaking when updating the theme and/or WordPress.
Have you tried to copy an existing file (exact copy of single_post.php for example) just to see if it works ?
If the page have header and footer, then the error is on this php file, otherwise it's somewhere else.
You can have an idea like that
I am creating a Wordpress custom theme, and I've been having issues with my woocommerce template rendering. Firstly, not all of the pages are showing up (some of them are reverting to the index.php and page.php files). Secondly, for the pages that are showing up (the single product page, the archive products page), the css is not being applied. I have tried everything suggested on the docs (hooks), but I have failed. Here is a link to my github for you to see the file structure.
https://github.com/naderae/elbe-collections
possible issues wuth my code:
my code is not written in the standard wordpress way. I only have three pages so far, index.php, page-about.php, and page-team.php, which work fine. page.php and single.php are empty. thus, my site consists of 2 pages, and index.php.
I've been struggling with this for 2 days, and would really appreciate some guidance of hoe to get me back on track. Cheers
Below is a list of some basic theme templates must preset in theme, more about this in details click here.
index.php
style.css
header.php
single.php
page.php
category.php
archive.php
404.php
I would recommend you to start with some default WordPress theme like twentyseventeen theme or other. These themes will have all basic functionality of WordPress. Check functions.php in the theme folder to customize/add functionality.
for more details about Template Hierarchy click here
Customize WooCommerce
Template structure & Overriding templates via a theme - link
Customizing WooCommerce - link
To overwrite woocommerce css you need to add a woocommerce folder to your theme. And go from there.
Woocommerce will also always use their own templates so the easiest way to change the layout is to use a child-plugin from woocommerce.
I want to have unique css styling in wordpress. I heard about page templates, but do they work on child theme. Is it possible to create template for my page in my child themes folder?
I am using WPbakery visual composer for my content.
Is it enough to write a page-659.php and put it to my child-theme and build my content as simple html page or are there any other solutions, to have a part content from parent theme's templates?
How to transfer a full content from parent theme for editing in my child theme page template? My parent theme uses framework, I want to skip it, and edit raw code? Is copy source code from web a good idea?
You are kinda stating the obvious... have you tried it? You seem to have the steps all figured out... and you're spot on.
Hi I'm new to wordpress I have been working on a theme I would like to have the original category.php file that needs to get added on the theme? I have tried to copy a category.php file from a theme that was created on the core of wordpress but the body is missing, where can I find the original category.php file template that will be used by wordpress when it is not being defined on my theme?
version: wordpress 3.5.1
As templates are going to have theme specific markup, you'll need to make revisions to any file that you plan on copying over if you want the page to work with your theme.
A simpler solution is to copy your page.php file and replace your post loop with that of the categories loop. This will allow you to easily maintain your site's design without having to rework any markup and can be accomplished pretty quickly by copy/pasting a category loop snippet.
A great starting place to see how these loops are structured is the WP twentytwelve theme found here: http://wordpress.org/extend/themes/twentytwelve
Much greater documentation can also be found in the codex here: http://codex.wordpress.org/Category_Templates
Template files are stored in:
/wp-content/themes/<theme_name>/
You can copy the category template from a theme, but then it wouldn't look like it's a part of your theme though and might be badly styled because of missing CSS rules.
I've created an HTML page as part of my website which I would like to use as a template for news articles. The page has all the things it needs, it just needs to display the correct news article in it.
I installed WordPress on my webserver and now wonder how I can have wordpress publish articles using my HTML page?
Is this even possible since WordPress works with php?
thanks
What you are talking about is themes. Wordpress allows you to create a theme for your installation so it displays using your html/css (more or less)
The way I do this is copy the default theme and make changes in there, and then you can switch to your new theme in your settings.
Edit: in addition, you can also load up wordpress on any page using:
include( '/path_to/wordpress_install/wp-load.php' );
This will allow you to use wordpress functionality on any page of your site.
just edited the single.php file by pasting the desired html code and leaving the loop code there where the text needed to show up.
didn't need to break up the page in a header, body and footer. Left out sidebar for now, but will put it back after I edit it properly.