How to edit Wordpress code for a specific page? - wordpress

I feel kind of stupid asking this but... I have three pages on my website. There is one of them I want to edit. How do I access the code of this page? I need to change the size of a Google Maps I have embedded on the page.

Go edit this page, in the right sidebar look for Template in page attributes box. This page should be using a template, go to your theme folder and look for a php file with the similar name, when you open, it should have the exact template name in the header, that's where you can edit the code of this page assuming that it use a template.

I managed to solve the problem by playing around with some divs in the css.

Related

Copy the contents of existing page to another page with different name in wordpress without using any plugin

I am new in WordPress. In my WordPress application having one page named "Retail". I want to create new page named "Website" with the same content of "Retail" page. I copied content and paste in to new page editor and saved. But some CSS problem is there. I think css file is missing kind. How to resolve this problem?
We cannot find the problem without any real information. However you can check if any of the following issues occurs:
You use a theme which let you add custom CSS rules in specific page. You might have a settings button in the page where you add it. In that case, you need to copy that as well.
You need to check your CSS files and see if the styling rules are applied for a specific page. It could be like .page-id-662 or .pageid-662
The last you could check is the functions.php file in case you enqueue a styling CSS file on specific pages as well.
What did you do exactly?
Created a new page in the Wordpress backend and copied the contents of "Retail?
Or put on a whole new Wordpress website and copy the "Retail" page there?
And please give an example of what went wrong in the design. Can you possibly specify the HTML code of an element with a design error?

How to have single-slug behave like a normal page in WordPress?

I'm making a website in WordPress, and I'm using a plugin ACF PRO. I'm doing the entire site with flexible content, so the WordPress site is like a page builder.
Everything is fine, however, I came to a point where I need to have same functionality for single-[custom-post-type], so I can "Add row", header, footer etc... on it, but I can't figure out on how to do it.
I know that it's possible, because e.g if you look at this site here: https://rolleragency.co.uk/our-projects/
You can see that it works. I know they are using flexible content because I worked on that site and I did there what I wanted. I can't remember how to do that.
I think I had to use a Tempate Page? Or? I can't remember.
THe site is built entirely on flexible content, so everything there is modular and it's like a drag and drop, but how do I do that on single-slug?
You have to create a page template, yes.
So something like page-projects.php then in WordPress admin you would have a page called Projects.
The template you created should be automatically applied to this page. If it doesn't for some reason you can choose which template WP should use on the right side when editing a page.
Now, you can add whatever code you need to the page-projects.php. And also any fields you may need for that page you can set up in ACF by telling ACF to apply those fields to pages that use projects template.
This is how I would and did do it on several occasions :)

Finding a content of a page in cms

I would like to remove one of the pictures on this page http://www.seobrand.com/online-reputation-thank-you but when I click edit, the cms doesn't show those contents .Why and how to fix it ?
Your theme is likely using a function like;
get_template_part()
to render that part of the page. dig into your themes files for page.php and see if you can find a call like that. If you modify the template that corresponds with that call you will be able to see the markup and remove the picture from that content.

Request wordpress page and specify the page template

I have a website running Wordpress with a specific, custom theme and I would like to use some of the pages as an iframe within a different website.
The problem I am having is that I don't want to show the menu, header and footer, I want to use a different font and have the page load as quick as possible.
The best way to do this is to apply a different, bare page template to the page I want to embed as an iframe. However this will also affect the page when displayed on the website. There are plugins that will enable the content to be shown as json. This gets close to what I want to do but since it's an iframe I'd prefer to have some basic styling in there.
Is it possible to do the request for the iframe in a way a different page template is applied?
I've tried reading up about this but due to the sheer amount of articles explaining how the page template hierarchy works I've not been able to find anything explaining how to make the client influence this.
tl;dr can I do some sort of ?apply_template='page-bare.php' to enforce a different page template?
I think this might help you: Load post with a different template?
The way is:
Register new query variable
Redirect to a different template, when that query var is set
Create that template in the way you like it
get_template_part might also come in handy here.

Iframe implementation for Wordpress

Does anyone know a way to implement an iframe on a WordPress website. Every time I place the code onto the correct page, wordpress strips my code and the iframe breaks.
I was wondering if there was a plugin that allows iframe code to stay intact or if there is some form of shortcode to use.
I have tried:
[iframe url="http://www.youtube.com/embed/X3kLPtVjjhA" width="579" height="360"]
[fixiframe url="http://www.youtube.com/embed/X3kLPtVjjhA" width="579" height="360"]
and installed the "embed iframe" plug-in on my site but none of them seem to work.
I appreciate the help.
You don't need an iframe to post a youtube video, but to answer your questions about iframes in wordpess..
I am not sure what those plugins do. You can create page templates and have iframes in your pages without using any plugins.
Create a new page template and add the iframe in the php code for that page template. More specifically, create a copy of page.php and rename it. In the comments at the beginning of the file, edit the line with the template file name to Template Name: MyPage. Edit the page code and add iframe code where you need it. And select this template (MyPage) as the template for your page in page edit section wp-admin.
You can also add the embed code as meta information to page in wp-admin, and fetch this meta information in the code to display the iframe. In this way, you can use different iframes for different pages with a single template.
Let me know if you need help with this. I will post a complete solution
Why are you using an iframe to load a Youtube video, you should use the embed tag that they show under the video...
I have iframes in my wordpress for all the Facebook/twitter buttons and they work great!

Resources