Wordpress Blog Archive page - wordpress

I'm trying to make a archive page for my blog.
I have my wordpress installation at: domain.com,
The blog is on domain.com/blog
and all other pages / custom post types are working from the root
For instance I have a custom post type for clients, this cpt works on domain.com/clients with a for archive-clients.php an overview page.
Now I'm trying to make a same page for the blog but nothing is working.
The only thing that works is my index.php.

You should be able to create a file named archive.php
EDIT: more info below
If you want to have a special link for the /blog page create an extra template:
Wordpress looks for the template name to index page template listings. Example:
/*
Template Name: Blog Archive
*/
Technically, you can copy the code from the index.php or archive.php, create another file, put the copied code in it, and at the very top of the file inside of opening and closing php tags have template name code. This will allow you to create a new page named blog (or anything else) in the wordpress admin area, then you can assign it to a template named blog archive.
More information:
http://codex.wordpress.org/Page_Templates
http://codex.wordpress.org/Template_Hierarchy

Related

How to load Custom Template file in Wordpress running on WAMP Server?

I have used custom template file for invoices in woocommerce orders but the invoice pdf containing custom template does not load rather on clicking the button the page redirects to the bitnami home page and does not load the custom template. How can I fix this issue in localhost?
To change the invoice content in woocommerce you can create the same file and put in woocommerce folder in current theme File path should be same as like that exist in woocommerce plugin folder for invoice template .
Otherwise you can also use the invoice hooks to generate the custom invoice
Thanks

how to find Wordpress theme homepage file source code

my website using wordpress template and I want to edit the homepage but I can't find the source file of the homepage...i go to chrome - view source but can't find the index.php that has the source code of the homepage
how to find the file of the source code of the homepage
its depending on the file used by author. by the way, most of the themes have, home.php
front-page.php
index.php
otherwise, we can create a custom page in wp-admin and assign it as home page or front page to a wordpress, that will be configured on the settings page.
Go through it.
Start here https://codex.wordpress.org/Theme_Development to learn how WordPress themes are designed and coded.

How can i give different url to my post

I am creating a wordpress site Local.mensusa.com .
In this site I created so many post But all post showing same title (User Name) in title bar.
I need to change this with my post title .
Means each post should carry different articles.
Go to WordPress Dashboard. Select Settings menu. In that select Permalinks. In the page select he option Post name. Your problem will be solved. I am suggesting this answer in the sense that you already have created the .htaccess file in the WordPress root directory. If not then copy the code below appearing in the permalink page when you select your option in the Permalink. Paste the code into a file named .htaccess(you should create it) in the WordPress root directory.
WordPress dashboard > Settings > Permalinks > "Post Name" > Save Changes
Note: The above will only work if you have a .htaccess file that is writeable by the server.
If you're not happy with the URL you can go into the post in question and edit the permalink, this can be done under the title in the "Edit" post section.

Wordpress cannot find a link

I have a link in wordpress website. However, I cannot find the link to edit. I try to find it in pages and in template. I tried to edit a page but the page is empty. So where does wordpress placed my link? Is it in database or somewhere?
Thanks
Homepage template can be index.php, home.php or front-page.php located in your theme's folder.
Find out which page is being loaded as your homepage in Settings -> Reading under Front page displays.
All the content in WordPress should also be accessible from within your Admin Panel. You have to find that out yourself. Only people who have access to the Admin Panel knows about that. Ask the person who was responsible for this if you must.

How does Wordpress route index.php when a front-page.php is present in the theme?

I just set up a wp theme featuring a front-page.php.
When I point my browser to http://mydomain.com/ the front-page.php is loaded. That's ok.
But... which URL will now trigger the index.php template?
Thank you in advance for your feedback.
Matteo
index.php is the main file for the theme. It contains the code for the Main Area (below header & above footer) and will specify where the other files will be included.
Your site may be loading front-page.php because you may have set static page in your settings to be shown as home page.
Acording to wordpress official doc:
index.php
The main template. If your Theme provides its own templates, index.php must be present.
front-page.php
The front page template, it is only used if you use a static front page.
home.php
The home page template, which is the front page by default. If you use a static front page this is the template for the page with the latest posts.
See this Link for more details on wordpress template hierarchy: WordPress Codex « Theme Development « Template File List
Having said that, mention your site URL in question and may be I can help you more.

Resources