Enjoy an ad free experience by logging in. Not a member yet? Register.
|
|
Results 1 to 9 of 9
Thread: How to put code in Loop?
-
04-11-2016, 05:20 PM #1New to the CF scene
- Join Date
- Mar 2016
- Posts
- 9
- Thanks
- 0
- Thanked 0 Times in 0 Posts
How to put code in Loop?
Hello.
It would be great if someone here could help me because I keep looking and looking but can’t find a solution since I’m new to WordPress. I need to put a plugin’s code inside the theme’s loop but I don’t know where exactly I should place it. I don’t even know which theme file contains the loop. Is it the style.css?
Anyway, the plugin is for displaying featured images inside the posts and it’s this one:
https://wordpress.org/plugins/featured-image/
Until now I have been putting manually the shortcode before each post but I want it to be automated. The creator of the plugin says this is the code that must be placed inside Theme Loop:
<?php if ( function_exists(‘get_featured_img’) ) get_featured_img(); ?>
I tried to contact him but unfortunately he has not replied.
I hope you could help me!
Thanks.
-
04-11-2016, 10:55 PM #2Master Coder
- Join Date
- Jan 2011
- Location
- Washington
- Posts
- 6,251
- Thanks
- 30
- Thanked 859 Times in 857 Posts
You are in the HTML section asking about PHP.
If your site ends in .html your code does not work. The site must end in.php.Evolution - The non-random survival of random variants.
Physics is actually atoms trying to understand themselves.
-
04-12-2016, 12:04 AM #3New to the CF scene
- Join Date
- Mar 2016
- Posts
- 9
- Thanks
- 0
- Thanked 0 Times in 0 Posts
But the site does end in php.
-
04-12-2016, 12:27 AM #4
-
04-12-2016, 12:33 AM #5
FYI - I've moved this thread to the PHP forum.
-
04-12-2016, 03:56 PM #6New to the CF scene
- Join Date
- Mar 2016
- Posts
- 9
- Thanks
- 0
- Thanked 0 Times in 0 Posts
Ok, which php file's code should I share here? single.php?
-
04-12-2016, 07:29 PM #7
Unfortunately, I'm not able to answer that confidently. I generally don't like using Wordpress, as my projects are generally more custom oriented programs, than a regular website. What the author of the plugin means when he says, "The Loop". Is the code that generates the post. So, when you are in the back-end of Wordpress, and you have entered in your title and content and all that happy stuff; When you hit submit, a script is running that takes all the information you just input and then inserts it into a database so that it can consistently draw on that information and show that specific post for each user that visits your site.
-
04-13-2016, 04:19 AM #8Master Coder
- Join Date
- Jun 2003
- Location
- Cottage Grove, Minnesota
- Posts
- 9,822
- Thanks
- 8
- Thanked 1,121 Times in 1,112 Posts
Do the featured images appear on every page, or every post, or only pages with posts, or only the main page?
Is there only 1 featured image for each post?
We have no idea what your rules are for featured images, or what your website is supposed to look like.
My idea of featured images are images that appear on pages, unrelated to posts.
???? What are they in your world?
-
04-13-2016, 08:15 AM #9New Coder
- Join Date
- Jan 2016
- Location
- pakistan
- Posts
- 20
- Thanks
- 0
- Thanked 0 Times in 0 Posts
largest cities in the world Click abcnewspoint.com to see the latest updates of your required category.
new hip hop songs Please check this website links.



Reply With Quote


