Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/test-syntax.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Run tests

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
php:
name: Testing
runs-on: ubuntu-latest
env:
PHP_VERSION: '7.4'

steps:
- name: Checkout the project
uses: actions/checkout@v3

- name: Setup the PHP ${{ env.PHP_VERSION }} environment on ${{ runner.os }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
tools: phpcs, phpunit
extensions: imagick, mbstring

- name: Searching for PHP syntax errors
run: find -L . -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l
40 changes: 40 additions & 0 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,46 @@
<link rel="shortcut icon" href="<?php echo esc_url( get_stylesheet_directory_uri() ); ?>/assets/img/favicon.ico" />
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">

<!-- Twitter Card data -->
<?php
if(is_single() || is_page()) {
$twitter_url = get_permalink();
$twitter_title = get_the_title();
$twitter_desc = get_the_excerpt();

if ( has_post_thumbnail() ) {
$twitter_thumb = get_the_post_thumbnail( $post, 'small' );
} elseif ( okfn_get_first_image_url_from_post_content() ) {
$twitter_thumb = okfn_get_first_image_url_from_post_content();
} else {
$twitter_thumb = null;
}
$okf_theme_options = get_option( 'theme_options_option_name' );
if ( ! empty( $okf_theme_options['okfnwp_twitter_id'] ) ) {
$twitter_site = $okf_theme_options['okfnwp_twitter_id'];
} else {
$twitter_site = null;
}
$twitter_creator = get_the_author_meta('twitter');
?>
<meta name="twitter:card" value="summary" />
<meta name="twitter:url" value="<?php echo $twitter_url; ?>" />
<meta name="twitter:title" value="<?php echo $twitter_title; ?>" />
<meta name="twitter:description" value="<?php echo $twitter_desc; ?>" />

<?php if ($twitter_thumb) { ?>
<meta name="twitter:image" value="<?php echo $twitter_thumb; ?>" />
<?php } ?>
<?php if ($twitter_site) { ?>
<meta name="twitter:site" value="@<?php echo $twitter_site ?>" />
<?php } ?>
<?php if ($twitter_creator) { ?>
<meta name="twitter:creator" value="@<?php echo $twitter_creator ?>" />
<?php } ?>
<?php } ?>
<!-- end Twitter Card data -->

<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
Expand Down