Wordpress theme from scratch shortcode error - wordpress

I am transfering my static website into Wordpress. I have created necessary files (header.php, index.php, etc.) and separated content to these files.
Site is working perfectly now, but when I try to include any gallery plugin via shortcode, gallery is not displayed properly. I think some css or js file is not loaded, but browser console log is not showing any error.
Question is: do I need to modify my theme files to get shortcodes working?
My site: https://novy.woodtek.cz
Shortcode is supposed to be displayed in "Reference" section. It is there, but not visible.
Please help me. I will be glad for your ideas.
Thank you
Eduard

I have found the solution. Problem was that I had not 'wp_head();` in header.php and wp_footer(); in footer.php.
Now it is working.

Related

WordPress blog finding related PHP

I am trying to edit a WordPress site. When I try to edit the x.com/blog/ page nothing happens.
I am trying to find out which PHP files are related to set up the blog page, but I do not know how.
If I can find the right files I can edit those. So how can I edit the /blog page in Wordpress?
Open Admin Dashboard and edit page blog page and check which template is currently using for that page.Then go to "/wp-content/themes/[your-theme-name]/" and find that template.
https://developer.wordpress.org/themes/template-files-section/page-template-files/
Alternative you can check if x.com/blog/ is coming from archive page which is custom post type page. You can find it via go to "/wp-content/themes/[your-theme-name]/archive-blog.php"
https://codex.wordpress.org/Post_Type_Templates
Go to /wp-content/themes/[your-theme-name]/. All files which are responsible for rendering the output can be found there.
Most likely index.php, home.php, front-page.php or page.php are responsible. The exact responsibility depends on the structure of the used theme.
Simple drop a
echo "This file is used currently.";
into the top of those themes and check if this appears in the source code if you are reloading the page.
Also make sure that any caching plugins are temporarily deactivated.
The basics on how WordPress themes are made and which template part is called can be found here: https://codex.wordpress.org/Theme_Development

Shortcode in custom theme not showing no matter what

I made a simple WordPress theme which I'm testing locally. I got a Instagram feed plugin which gives me a shortcode to add anywhere on my blog/theme. The problem is, the shortcode does not display the feed or anything for that matter but I can see the feed's code (div) when I check the page source code. Other shortcode works but not this one. The Instagram feed works on other themes but not mine. I've tried almost all the online solutions (add_filter, do_shortcode etc) but none works.
I'm sure the problem is not in the shortcode or plugin because it works on other themes and maybe there is some problem with my theme. I had also made a WordPress theme before and the feed doesn't work even in that. I don't what code to show because I really don't the where the problem is in my theme. Any help will be appreciated.
Edit:
The shortcode is [instashow id="2"]
I've tried adding that to a page but that doesn't work. I've also tried adding <?php echo do_shortcode('[instashow id="2"]'); ?> in the template itself but that doesn't work either.
You checked to see if the plugin settings are correct?
The next step would be to check other shortcodes in other plugins to see if other shortcodes work or have problems too.
First you have to make sure if the problem is caused by the theme or the plugin.

Loading wordpress page content in colorbox Iframe

I'm building a Wordpress site using the colorbox plugin.
I'm using text-links which open a webpage in an Iframe. That works fine.
But now, I want to load the content of a certain wordpress page in it, particular an Item portfolio page created with the Nimble portfolio plugin.
I think I have to use some basic code like
Contact
but I can't fix it.
Any suggestions?
Thanks for your sympathizing comments on my first question on stackoverflow.
I'm sorry if my question wasn't clear enough, but the site where the problem shows up is still in development.
But fortunately I've figured it out after a long time:
Next to single.php I created a singe-portfolio.php file, because because of the Wordpress hiërarchy, WordPress finally looks for singe-{filetype}.php.
In the Nimble Portfolio Loop, I linked to this file with the following code:
...
In the single-portfolio.php file, I used a regular WordPress loop to get the page content in the JQuery Colorbox Iframe.
Hope this will help someone else!

Links from the Homepage to the other pages don't work

I have experience in designing/developing websites (static/dynamic). But new to wordpress :(. Recently I have created a CSS/XHTML website for a client who wanted it to be lunched using wordpress. I've converted the CSS/XHTML into a wordpress theme as I thought it might be easier than customizing another theme to fit my CSS/XHTML structure. Everything worked well locally. But when I uploaded files into the server (Styles, footer works fine.) homepage opens up fine. But when I click on the link to "about.php" page it doesn't work.
Initially all the links were loading the home page. Then I searched and changed the permalink structure to default and the "about.php" link gave 404 error. Then I replaced the "about.php" link into <?php bloginfo('template_directory'); ?>/about.php as it was adviced in another article. Then it just opens up a blank page.
After struggling for a whole day, still stuck in the links issue. Hope any of you experts could save me. :)
Thanks in advance.
I think you are in wrong way. You have to see the template hierarchy first and then you have to go throught the wordpress administration panel and create your own menus

How can I get WordPress to recognize my newly created page template?

I recently created a new template page, I put the obligatory
<?php
/*
Template Name: New Page Template for testing
*/
?>
as the first part of the code.
Then I uploaded it to the /www/wp-content/themes/neoclassical (where all of the other custom page templates are located).
I now try to change the Template of any page to the new theme, and the new page template does not show!
Any ideas on what I need to do to get this to show up as an option on the "Add Page" area?
I have tried changing the theme to another one and back to the original theme, all to no avail.
Thanks everyone.
For future visitors:
I just had this problem in WordPress 4.8. Turns out I had removed the index.php file from my theme, which was causing the theme not to show the template dropdown.
To fix this just create an empty index.php file in your theme folder.
(WordPress does try to warn you this file is missing on the Themes page in the admin panel — but you might not visit that page while trying to fix this bug.)
Update: Trace has mentioned in the comment below that a missing style.css can also cause this to happen.
if the code of the custom template is not good. it wont show.
try using one of the examples here.
http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates
So, it turns out that the original developer had put the backup copy of the site in the "LiveFiles" directory, and had pointed the site to "Stuff". I was just uploading to the wrong area.
you just write this sentence and go to admin panal and add new page than you see Template box and find your template page name.
In case this suddenly happens in a working theme, try to delete delete the row starting with _transient_files from wp_options table. That solved the issue for me.

Resources