How to change Divi blog elements order? - php

I have experience with Wordpress but is my first time with Divi. Based on the client design, I need simple change. On the image below you could see block from the blog(a post list used on the homepage in my case)
What I need to do is showing the date, category and title in a different order. Which is the best way to change this. I'm using a child theme and I tried to put the file includes/builder/module/blog.php and edit it but I don't have any luck.
Thanks

Do you have the divi page builder ? If so, it might be possible in the settings of the section where your post is located (you can edit it directly from the front end editor).

Related

How do I edit the archive page for the Divi theme?

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.

Adding a widget to all blog entries (using the blog module)

I am trying to add the same widgets to ALL of the blog entry pages. Perhaps add them to the blog holder page and inherit them on all blog entry pages. I want the widgets to be automatically assigned to all blog entry pages without having to manually add the widgets.
Is there a method to pull from parent, or is there a way built into the blog module to achieve this? Thanks in advance.
I don't know how widgets work since I do not use theme. If it's saved in a relation something like the following could help you out.
Silverstripe 3.1.x getting values from Parent
or as a Extension/Decorator
https://gist.github.com/lerni/1e046af2005494636707
I believe that is standard (default) behaviour.
As you say, add them to the Holder page, then set blog pages to inherit (default I believe).

how to replace excerpt with full posts on WP

First thing first, i'm new with WP and i'm also not very good with PHP.
anyway, i use this plugin http://wordpress.org/plugins/posts-in-page/ to group all the posts that i create inside a specific page and it works good.
Now, i'd like to change the code so that all my posts displayed on the page are not excerpt but the full posts.
I need a full explanation on how to do that cause as i said above i'm new both in wordpress and PHP.
thanks a lot.
There are two ways of doing this. One is to go to the Reading Settings in the Administration interface and select your desired option under For each article in a feed, show….
The other way is to hardcode this in the theme itself. Open the template file (index.php for example) and replace the_content or the_excerpt with the_content.

Wordpress plugin using existing theme

I am building a plugin for the first time and I have setup my rewrite rules to call a PHP file I have located in my plugin folder and this is working but all I have it output just now is "test"
I wanted to ask, is there is a way of pulling in the existing theme and using this as the basis for the page, then I can have my plugin just output the page content area so to speak.
My plugin is quite big in terms of the amount of data it handles so I would like to be able to use a menu link to the aforementioned file and this file can then output all the sub pages of content but still using the default theme (theme I have made) and fill the content area only is this possible and if so is there anything to explain this already available because I couldn't see it.
Any help with this would be much appreciated.
Edit: I have tried including a file from my current theme but this will give me a 500 error so I assume its not as simple as this.
Have you thought about using custom post types for your plugin content rather than relying on custom tables and separate code?
Other than that, you could use a shortcode (just one) and have users insert that into a regular WP page, the shortcode then displays all of your various plugin stuff.
It's hard to be more specific without understanding why you've done it this way.

Make special pages from WordPress theme?

I'm trying to figure out how a certain WordPress sets things up. I'd like to have a special page where I could make WP calls and interact with the theme, without affecting anything else.
I just making test.php and putting it into my theme's folder, but that doesn't work.
#Eliran provides one possible option, but you could also add a page in the back-end of WP, just make sure it has the slug 'test', and change your 'test.php' filename to 'page-test.php'. If you're worried about the public seeing this, set the page visibility in the admin to 'private'.
Edit:
to move your understanding along a little further also, you should review the way that WordPress determines what file to grab to render a particular URL. This can be pretty confusing to start with, so be patient if you're not familiar with it, but it's at the heart of designing WP themes. I'll link to the examples, and if you scroll down a little there's a diagram that, along with the text, will help you see how WP is 'thinking'.
http://codex.wordpress.org/Template_Hierarchy#Examples
You can see here: Page Templates
all you need to do is create a page named page-{custom-name}.php and add it to the theme folder.
and inside this php file add:
/*
Template Name: My Custom Page
*/
and than to use this page you need to go to the wp-admin, add/edit a page and chose it:
inside the php file everything you do is classic wordpress.
all this is giving you is a custom page tamplate.
Put it in your root folder. When you go to look at it, you'd look at www.mywebsite.com/test.php
It may be other ways to do this, but I rather use the rewrite API and custom query vars, to create custom routes.
A previous answer on the subject can be found here
The basic idea is to add a new url rule, catch the query var with the parse_request filter and maybe do a die or redirect to prevent the default wordpress template from loading.
I prefer this over theme templates, because with templates you need to create a page for each new url, and if that page gets acidentally deleted, that functionality would stop working.
What Pages are Not:
Pages are not Posts, nor are they excerpted from larger works of fiction. They do not cycle through your blog's main page. WordPress Plugins are available to change the defaults if necessary.
Pages cannot be associated with Categories and cannot be assigned Tags. The organizational structure for Pages comes only from their hierarchical interrelationships, and not from Tags or Categories.
Pages are not files. They are stored in your database just like Posts are.
Although you can put Template Tags and PHP code into a Page Template file, you cannot put these into the Page or Post content without a WordPress Plugin like Exec-PHP which Read overwrites the code filtering process.
Pages are not included in your site's feed.
Pages and Posts may attract attention in different ways from humans or search engines.
Pages (or a specific post) can be set as a static front page if desired with a separate Page set for the latest blog posts, typically named "blog."
More About Pages.
In WordPress to add a new page you have to log in to the admin/backend and from the pages menu you can add a new page. In this case, you can select templaes for your page and also you can create a custom page template for that page.
You may read Createing a new page in WordPress. and custom Page template in WordPress.

Categories