WORDPRESS: add_theme_support( 'post-thumbnails' ); doesn't work? - wordpress-theming

I'm customizing a wordpress theme. And now, my theme doesn't have Feature Image function.
I've tried reading https://codex.wordpress.org/Post_Thumbnails and found out that I need to add the line: add_theme_support( 'post-thumbnails' ); to the function.php and hope that "If your theme was successful in adding support for Post Thumbnails the "Featured Image" metabox will be visible on the on the Edit Post and Edit Page screens." as they said in codex.wordpress... But the magic didn't happen.
I've tried mimicking the TwentyTwenty theme for that but didn't succeed. Also found a lot of asked question here but didn't help much.
I don't know if some more steps needed? Could you please help me out? Thank you in advance.

Luckily I fixed my problem.
- The right name of the file functions.php is in plural noun (functions).
- Including <?php and ?> helps.
I know it maybe basic knowledge. I just post here so that perhaps it is useful for someone.
Full working code for functions.php:
<?php
add_theme_support( 'post-thumbnails');
set_post_thumbnail_size( 50, 50 );
?>

add_theme_support('post-thumbnails');
please look at the syntax correctly sometimes you may write post_thumbnails and get stuck.
it's
post-thumbnails
not
post_thumbnails

Related

How to make a custom Archive page with Wordpress using custom post types and acf fields

I am building a child theme on GeneratePress to create a custom site for a client and am stuck on customizing the Archive pages. I've determined that it will be best to ignore the theme functionality and build the page loops from scratch. The custom archive should take the place of wp/generatepress' standard archive page and function in the same way by showing relevant posts when a taxonomy term is clicked. I need to be able to choose which html tags are used and style them with css. My issue is that I don't understand wordpress dev enough to figure out how to do this.
I have two custom post types, Research and Resources, as well as a bunch of different custom taxonomies that are applied to both or each post type. I'd like to customize the archive page (with archive templates if necessary) so it displays the appropriate Research and/or Resource files when visited.
I understand that I need to loop through all the posts, but I do not know how to grab only the relevant ones per the given archive page.
Examples of loops with example content will be the most helpful. Thank you!!
I chatted with someone on Reddit who kindly answered this question for me here.
They said:
So I wouldn't do it as a template personally (you could), I would do it through having two new files a archive-research.php & archive-resources.php.
Then if the loop is going to be the same on both pages, which I think you said it is going to be (you just want to display the posts from each custom post type), I would use a template part.
So create a new folder in your theme folder called inc or includes and name the file custom_post_loop.php (name can be anything).
Then in your archive page, call...
<?php get_template_part('inc/custom_post_loop');?>
In that file you are just wanting to write a simple post loop in there.
while ( have_posts() ) : the_post();
// Your loop code
// just so you can see this work I have called the title
the_title();
endwhile;
else : _e( 'Sorry, no posts were found.', 'textdomain' ); endif; ?>
https://developer.wordpress.org/reference/functions/have_posts/
Have a look at that link to find out more. But thats the direction to go...
If you really wanted to got the direction you have with the template, you would have to add arguments to your posts loop.
it works the same way but instead of archive.php its taxonomy.php...
However, you don't want a taxonomy-{taxonomy name}.php file for each taxonomy as that would be ridiculous unless you knew all the taxonomies haha and had really specific user cases for them...
so just create a taxonomy.php in your theme files and to make sure its working just add this code to it...
<?php get_header();>
<h1><?php the_archive_title();?></h1>
//then put your loop in from earlier...
<?php get_template_part('inc/custom_post_loop');?>
<?php get_footer();?>

Cakephp 3 Element file is missing

I have the problem that my navbar.ctp element isnt loading i only get the error message from cakephp
Element file "Element/navbar.ctp" is missing.
My code in my default layout of cakephp (because i want the navbar in all "views")
<?php
echo $this->element('navbar');
?>
and my element is in Layout/Element/navbar.ctp
So i dont unterstand why it says me that my element is missing.
Do i have anything missing?
I hope someone could help me with the problem. I dont have much information, because its not complicated per se.
I think you have the file in the wrong folder.
Check the cookbook:
Elements live in the src/Template/Element/ folder, and have the .ctp
filename extension. They are output using the element method of the
view:
echo $this->element('helpbox');
Source: https://book.cakephp.org/3/en/views.html#elements

ErrorException Cannot redeclare class Concrete\Package\MolliePlugin\Controller in Concrete5 website

I'm new here, so I hope I'm doing this right. I inherited a portfolio of websites and one is a Concrete5 website. Unfortunately I don't have much experience with Concrete5 and I directly start with a site with an issue :(.
When I go to https://www.example.nl/index.php/dashboard/extend/install I get the following error.
Whoops \ Exception \ ErrorException (E_COMPILE_ERROR)
Cannot redeclare class Concrete\Package\MolliePlugin\Controller
Image of the exception
I hope that someone can give me some guidence on this.
Thanks
Okay I found the issue when looking in cPanel: there was mollie_plugin and mollie_plugin_not_working. I guess that my predecessor had an issue and renamed the folder and added the extension again.

Display Blogtitle in HTML-Textfield

On my wordpress site on the sidebar I have a text widget. I want do display the blogname (blogtitle) there. I want an HTML code, that crab and show the blogtitle by itself. I tried with this code but nothing happened:
<?php bloginfo('name'); ?>
I searched on Google but didn't find anything useful.
Can someone help me please?
When given the 'name' as parameter Wordpress looks for “Site Title” set in Settings > General. Check if this is set.

How to properly create a pdf with fpdf?

I have some code to try to create a single PDF document but i can't do it.
code :
<%# language="vbscript"%>
<!--#include file="fpdf.asp"-->
<%
if Request.form("test") <> "" Then
Set pdf=CreateJsObject("FPDF")
pdf.CreatePDF()
pdf.SetPath("fpdf/")
pdf.SetFont "Arial","",16
pdf.Open()
pdf.AddPage()
pdf.Cell 40,10,"Hello Word!"
pdf.Close()
pdf.Output("list.pdf","T")
End If
%>
So, (dont mind with the request.form for execute..lol)
when i click the button i get :
"FPDF error: Unable to create output file: list.pdf"
I've tried some sites for help and done alot of things and searched here on stack and found some useful things but nothing directed to this ...
Any help would be appreciated ! I can try to answer any questions you may have about the code or something else.
Also, if you have another solution for creating PDF's with classic ASP, please lemme know (free or very low price)
Thanks for your attention !
I've specified the path of Output to a VIRTUAL location and it Works great !
Thanks Every one for your help !
Best Regards