Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have an html website, I then have a php section of the website in wordpress for a shop page.
I want to use my current footer and header from my html pages for my php shop pages.
Any suggestions?!
Put the section inside the tags of your HTML page, and you should be good to go. Make sure to rename your files from name.html to name.php, otherwise the PHP code inside cannot be used. Without specific code examples, we are not able to help you much more then this: If you can, update your question with code examples and what you've tried already, so we are more likely to be able to help you.
Code example
<html>
<body>
<!-- Normal content goes in here -->
<?php
// Your PHP code goes in here
?>
</body>
</html>
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have this front-page.php page in my site and I want to put a block code directly in the php page. So I got a div and I want to put it in there. But the code is like
<!-- wp:latest-posts {"postsToShow":3,"displayPostContent":true,"excerptLength":30,"displayPostDate":true,"postLayout":"grid","displayFeaturedImage":true,"featuredImageSizeSlug":"large","align":"wide","className":"tw-mt-8 tw-img-ratio-3-2 tw-stretched-link is-style-default"} /-->
It's from a widget. I coudn't make it work please help :D
You can insert block code into any php template by using the function do_blocks() and passing in (valid) block content as a string, eg:
<?php
$block_content = '<!-- wp:latest-posts {"postsToShow":3,"displayPostContent":true,"excerptLength":30,"displayPostDate":true,"postLayout":"grid","displayFeaturedImage":true,"featuredImageSizeSlug":"large","align":"wide","className":"tw-mt-8 tw-img-ratio-3-2 tw-stretched-link is-style-default"} /-->';
echo do_blocks($block_content);
?>
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I'm trying to achieve the following below:
Click here to see a diagram of what I'm trying to do
Pull first content using the code in figure 1.
Have some sort of slideshow/gallery system.
Pull the remaining content using the code in figure 2.
Currently I just get duplicate content, I'm obviously doing something wrong.
Can anyone advise?
Yes, It is wrong. You can use <?php the_content();?>only once in one page. If you want to show different content, put that content in widget and call the widget in page.
<?php dynamic_sidebar('id-of-widget-goes-here'); ?>
for example :-- <?php dynamic_sidebar('sidebar'); ?>
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
So as the titles already states, is it possible to build a fully functioning wordpress page layout/theme using only frontend languages? And how will I incorporate it into wordpress without php?
Thanks!!!
Well no but you could certainly get away with using very little.
Just have
<?php get_header(); ?>
at the top of every page and
<?php get_footer(); ?>
at the bottom
A page named header.php with
<?php wp_head(); ?>
at the top and a page named footer.php with
<?php wp-footer();?>
at the bottom should get you going. From there just use html and javascript like normal.
HOWEVER this is leaving out 99% of the reasons to make a WordPress theme in the first place. It's a good place to start learning but if you want to make themes your gonna want to learn php.
This tutorial worked well for me.
https://www.youtube.com/watch?v=k7olvEeBM2I&index=3&list=PLpcSpRrAaOaqMA4RdhSnnNcaqOVpX7qi5
Good luck!
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I want something like Wordpress's system. I want to get header code from header.php so I will not have to edit all of the pages when I'm going to edit something.
You can never get the code because one the php page is render, it gets converted into HTML so you will always see html.
I understand, you need header component.
1)Create a file header.php (add navigation bar or logo or whatever you want).
2)Include it in other php files as include("header.php");
so all the pages will be using this one header.php file and you can modify it and the changes would get reflected all over the web app.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am making a website using HTML. I am not familiar with PHP. I need the navigation and header part to be in a single place. i.e., Once I change the menus in one place it should reflect in all other pages. Kindly help me on this.
Thanks in Advance.
You could use include or require to add your Menu-Html file in every page you wish.
you could add something like this:
<?php
include('menu.html');
?>
wherever your menu should appear in your HTML, having a menu.html file of course.
and you'll need an apache server or any other that can 'read' your php files.
include php documentations
require php documentations