Add a custom-made slideshow to Wordpress Theme - php

So i made a slideshow using HTML, CSS and JS.
It's for a personal blog i'm creating, so i would like to add the slideshow into a Wordpress theme that i purchased.
I created a child theme and tried to edit the function.php file and the style.css, and although i know some PHP it's really hard to understand how the code works and where to add mine.
Basically i want to display my slideshow initially, and then the rest of the Wordpress theme with all the posts and such.
Is it possible or should i only work with the customization options of the theme, although they're limited?

Since you've gone with a child theme, may I suggest copying a page template from the parent into your child theme?
Then you can copy your code for the slideshow via the editor into your child theme's copy of page template and use said template throughout your website for whatever page you'd like without colliding with parent theme updates.
Here's a relatively simple tutorial for creating a page template:
https://www.cssigniter.com/add-custom-page-template-using-child-theme/

Related

WordPress: Child theme + Custom Post Template

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

How can i have a pagination on my wordpress website

I'm trying to have a pagination on my custom Products page that is not the default one in Woocommerce.
I used Elementor to customize this page and after some research I saw that I could call a function that is already integrated in WordPress using the < paginate_links > function.
The only problem is that I have no idea where to call this function in order to have a pagination on my product page.
To be more precise, i would like to know where exactly i have to change or add my php functions, and what code should i use to get my pagination.
Normally it is in the archive.php or a version of that file name specific to your post-type. But before you go and change it, create a child theme in case you haven't done that already. In the child theme folder, you then duplicate the archive.php or similar to make it overwrite the one from the parent theme. This way you keep your version of the theme clean and updatable without losing any changes.
(For creating a child-theme you will need to create at least a style.css [with a WordPress-specific comment, you can google] and a functions.php-file that needs a bit of php-code to enqueue the child-themes scripts and styles. The code for the functions.php can also be found by a quick google search. You then just place the style.css and the functions.php into a new folder you name in the pattern [foldername of your themes name]-child. You then place this folder next to the parent-themes folder in the "/wp-content/themes/"-directory.)
And here you go for the pagination: https://codex.wordpress.org/Pagination

How can I import my custom CSS and HTML into Wordpress? And how do I prevent updates from erasing my code?

Summary: Question 1. How do I import css and html into Wordpress? Question 2. How do I protect it from being erased by a Wordpress theme update?
3. Is there an alternative that allows me to publish my code the way it is without a CMS, and if so what is it?
I built a website layout in my text editor using just HTML and CSS for a client. Her website is under 10 pages. Now I need to import this code into her CMS/website builder, Wordpress. How do I do this while protecting it from being deleted by Wordpress theme updates?
How to get code in wordpress:
In your theme files, there are the header.php, page.php, single.php, archive.php, footer.php, which are parts of your wordpress site. If you past your code in here, the pages where the theme files are used (for example the header and footer is used everywhere in the frontend in most themes), will include your code.
How to prevent being overwritten:
You can create a child theme of your theme. This way, it uses the files from the parent theme, but if you put a file with the same name in the folder of the activated child theme, it uses this instead of the file of the parent theme.
This way your changes will not be overwritten, when there is an update being installed at the parent theme.
This may be a good tutorial https://premium.wpmudev.org/blog/how-to-create-wordpress-child-theme/
Publish your code in the internet
You can use a webhost (there are thousends) or a repository. There are also free alternatives. Webhosting should bring you answers.

How to add custom page template to wordpress child theme?

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.

where to find the origing category.php file in wordpress?

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.

Categories