Change links in wordpress template without creating a table in database - php

I have a wordpress template which have some static content.
in fact the index page has a page template and its all static and have no control from wordpress.but using header and footer.
I want to change static links in this page using admin panel.
How to change this static links from wordpress panel without using a database to store this links?
thank you

You need to edit theme's files. Use Wordpress editor for this.
UPDATE
Install the plugin for managing options. For example, WP Options Editor
In your template replace the code that should be customizable with the
get_option('your_option_name');

Related

Roll out static folder as plugin and access via domainname.com/anyname

I would like to roll out static content via a word press plugin. Lets say the folder rolled out is located at domainname.com/wp-content/plugins/pluginname and I would like to access it via domainname.com/pluginname for example.
I have the following quesitons:
How would you roll out this folder if you like to have it some kind of installable.
How do we solve the access via the desired url?
Thank you for helping!
I am not sure what you are trying to achieve exactly, but here is a possible solution.
Create a custom page template in your (child) theme folder by making a file and include that will hook your custom template page to WP. (See this page for more information) On this page your can basically pull any WordPress functionality that your require.
<?php /* Template Name: Example Name */ ?>
Switch on Post Name option in your Permalinks settings for pretty permalinks and then create a new page in WP that will use your newly created template. On that URL you can access the code that you've supplied in the custom page template.

Add php/html file to Wordpress Themes

I am new on wordpress and are using the themes as well. May I know where do I put a new file if let say main.php? I want to make a custom main page and replace the index.php page on the theme. Do I need to put it under htdocs\wordpress\wp-content\themes\<theme-name>. I am using this locally on my computer.
On my main.php, I also include css file. Where do I insert the css file as well?
you can set your front page in wordpress dashboard customization options
Go to Administration > Settings > Reading panel.
and select the page listing in dropdown , but before that you have to create a new page and select you custom page from dropdown . see the below image.
refer this for more info
you can have your css file keep on style directory of your theme and link it in your main page using
get_template_directory_uri() . '/styles/your-style-file.css'
You have to create page template for this.
Have a look over below thread hope this will help you
https://developer.wordpress.org/themes/template-files-section/page-template-files/page-templates/

Adding my own static webpage to a wordpress site

If my title wasn't clear, basically what I'm trying to do is to add my own HTML or PHP page to Wordpress, so i can play around with some web dev.
So essentially I just want a test page/pages added to my site. However since I have installed Wordpress on my website, I can't just add "index.html" to my root folder using my FTP client. I wonder if I can/can't do this and if so how to link to the pages I add using FTP.
Sorry if this doesn't make any sense. I just want to add some of the sites I've already made / ones I am creating to my site so I can easily show clients/employers what I can do, and I apologize again if I'm being an idiot.
Create a sub-directory in your root folder and then simply link to it:
www.domain.com/mysubdir/index.php
the other way to do this... create a page template in wordpress
create a php file named: template_mypage.php
You must put this php comment line at the top of your template file:
/* Template Name: My Page */
go to wordpress backend and create a new page
in the "Page Attributes", you can find a drop down list named "Template". In the list, you should be able to find "My Page"... select it and then save your page.
view it!
You can always create a subdomain or create a folder inside public_html/www/ and redirect it from any other domain or from any static link you have on wordpress
Why not use WordPress and put your portfolio together using Custom Post Types? I recently presented on this and there is a handy plugin for Custom Post Types UI that you can create a whole new section of your site and make templates for your portfolio.
Just a thought.
If you do a static page in WordPress, you can still template using the Page system as specified in another comment. Code your page, separate it into header, footer, content, etc files. You can load the file to your root, but not name it index. If you do a subfolder, you need to not have an existing page in WordPress.
HOWEVER, you can still do a "halfway" static page still using WordPress and do a header-staticpage.php, index-staticpage.php, and footer-staticpage.php and make sure to include the code for WordPress header and footer in the new header and footer so you can still reap the benefits of the default jquery that WordPress allows. Don't forget to name your template and when you create the page in WordPress, you can just leave the content area blank if you have hardcoded the page's content in.
I still recommend trying Custom Post Types. It is not hard and there are some great presentations in Slideshare that cover this aside from the plugin I mentioned earlier in this comment.

How to insert a static page in WordPress

I have WP instance installed on hosting. I also have one static HTML page in its own folder with some graphic files that I want to use as landing page for the site. I don't want to insert it as WP page or anything like that, want to keep it simple. I have also permalinks configured. So I can't access the page just by going to www.mysite.com/landingpage/index.html now. Is there a simple way to make the static page accessible inside WordPress instance?
For each page, create a template, with the static text you want, the query for the category you want to display, and a copy of index.php of your theme.
Some links you may like to see.
http://wordpress.org/support/topic/creating-a-static-page-that-displays-posts
http://moshublog.com/2007/09/10/static-frontpage-combined-with-dynamic-content/
Wordpress static pages: how to embed content into templates?
Good luck.. :-)

wordpress use in own template

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.

Categories