[edited 17/04/23] - Apologies for the confusing question! I am a newbie here (definitely newbie with LaTEX) and I am not familiar with the format yet. I have added an example that hopefully will help and some further clarification. Thanks for everyone who helped already!
I am using the cleanthesis template and I want my figure captions to be able to break, if longer than the current page, and continue in the next one. This can be achieved with the capt-of package (example here: How do I make figure captions span multiple pages?). However when I use this approach with the cleanthesis template I can only move the whole caption to the next page.
Here is all the code related to captions from the cleanthesis template and how I set it up (marked with ***--> in the comments is what I changed):
In cleanthesis.sty:
\RequirePackage{capt-of}
% OPTION hangfigurecaption
% --> values = true|false
\define@boolkey[ct]{cthesis}{hangfigurecaption}[true]{}
\setkeys[ct]{cthesis}{hangfigurecaption=false}
\RequirePackage[ % modify figure and table captions
font={small}, % - small font size
labelfont={bf,sf,color=ctcolorfloatlabel},% - label in bold, sans-serif and magenta
labelsep=\cthesis@figuresep, % - separator: none, colon, period, space, quad, newline, endash
singlelinecheck=false % - no centered single-lined captions
]{caption}[2008/08/24]
%\ifthenelse{\boolean{@figurecaptionoutside}}%
\ifct@cthesis@hangfigurecaption
% {%
\DeclareCaptionFormat{llap}{\llap{#1#2}#3\par}%
\captionsetup{format=plain,labelsep=quad,singlelinecheck=false}% ***--> I changed the format to plain because \captionof doesn't like the other llap format
% }{}
\fi
In main.tex:
\usepackage[ % clean thesis style
figuresep=colon,%
sansserif=false,%
hangfigurecaption=true,% ***--> changed to true
hangsection=true,%
hangsubsection=true,%
colorize=full,%
colortheme=bluemagenta,%
% LLT: Use biber if using UTF8 encoding
% bibsys=bibtex,%
bibsys=biber,%
bibfile=bib-refs,%
bibstyle=alphabetic,%
]{cleanthesis}
% all the other commands not changed
\usepackage{kantlipsum} % just for the text in the test caption
\begin{document}
% Test for long captions
\begin{center}
\includegraphics{gfx/Clean-Thesis-Figure.pdf}
\captionof{figure}[Test caption.]{%
\kant[4-6]}
\end{center}
\end{document}
In this case, instead of breaking the caption like in the example above, it pushes it to the next page.
If anyone has some experience with this that will be really helpful! I am definitely not attached to the \captionof command, any other potential workaround that would allow me to break a long caption using the cleanthesis template would be very welcomed as well.
Thanks a million!

\RequirePackage, you are using{}and not()in your actual document right? As in,\RequirePackage{capt-of}. Hope someone can answer, I think your question could benefit from some code such as a Minimal Working Example (MWE), a lot of people here are not fluent in English but are fluent in LaTeX code so it would be helpful to include some for those who want to help :) – JamesT Apr 16 '23 at 15:37figurebut that is all it does, it calls the standard caption and the formatting will be identical. So it is hard to guess what effect you are wanting as you have shown no example – David Carlisle Apr 16 '23 at 15:40cleanthesishas an optionhangfigurecaptionto configure whether captions should be hanging or not. And AFAIK the default is alreadyhangfigurecaption=false. Moreovercleanthesisalso uses packagecaption. So you can use all features of that package not only to modify captions, but also command\captionofwithout loading one more package. – cabohah Apr 16 '23 at 16:20