Skip to content

Instantly share code, notes, and snippets.

@ahsannayem
ahsannayem / og:image
Last active January 16, 2025 06:32
The featured image is not shown when adding the post link on FluentCommunity or any social platform
function add_open_graph_tags() {
if (is_single() || is_page()) {
global $post;
$featured_image = get_the_post_thumbnail_url($post->ID, 'full');
$default_image = 'https://verenakrone.de/path-to-default-image.jpg'; // Replace with your default image URL
?>
<meta property="og:title" content="<?php echo get_the_title(); ?>" />
<meta property="og:description" content="<?php echo get_the_excerpt(); ?>" />
<meta property="og:image" content="<?php echo $featured_image ? $featured_image : $default_image; ?>" />
<meta property="og:url" content="<?php echo get_permalink(); ?>" />
@ahsannayem
ahsannayem / New Menu for FS
Created April 23, 2025 11:18
Add Menu Item For Fluent Support
add_action('admin_footer', function () {
$screen = get_current_screen();
if (!$screen || strpos($screen->id, 'fluent-support') === false) {
return;
}
?>
<script>
document.addEventListener('DOMContentLoaded', function () {
const checkExist = setInterval(function () {
const menu = document.querySelector('.fframe_menu');
@ahsannayem
ahsannayem / Login Page CSS
Created July 28, 2025 08:11
FluentCommunity
add_action('fluent_community/headless/head', function() {
echo '<style>
.fcom_layout_side {
background-color: #2c2e34 !important;
}
</style>';
});
@ahsannayem
ahsannayem / FC Dark Client
Created July 29, 2025 09:28
FC Dark Client
add_action('fluent_community/headless/head', function() {
echo '<style>
label {
color: #fff !important;
}
a {
color: #fff !important;
text-decoration: underline !important;
}
@ahsannayem
ahsannayem / FluentCRM Tag Adding
Created October 1, 2025 10:40
Add tag when Status change from Pending to Subscrived
add_action('fluentcrm_subscriber_status_to_subscribed', function ($subscriber, $oldStatus) {
// Only act when moving from pending to subscribed
if ($oldStatus !== 'pending' || !$subscriber || empty($subscriber->id)) {
return;
}
$tagName = 'Onboarding'; // change as needed
// Ensure the tag exists (FluentCRM model API)
if (class_exists('\FluentCrm\App\Models\Tag')) {