Make WordPress Themes

Changeset 356259


Ignore:
Timestamp:
10/30/2026 08:08:19 AM (3 hours ago)
Author:
themedropbox
Message:

New version of Pressora - 1.0.11

Location:
pressora/1.0.11
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • pressora/1.0.11/functions.php

    r352897 r356259  
    1515
    1616if ( ! defined( 'prssa_VERSION' ) ) {
    17         define( 'prssa_VERSION', '1.0.10' );
     17        define( 'prssa_VERSION', '1.0.11' );
    1818}
    1919
  • pressora/1.0.11/header.php

    r349173 r356259  
    1313
    1414        <link rel="profile" href="https://gmpg.org/xfn/11">
    15 
    16         <?php
    17         // Output favicon from Customizer if provided
    18         $prssa_favicon = get_theme_mod( 'prssa_header_favicon', '' );
    19         if ( $prssa_favicon ) : ?>
    20                 <link rel="icon" href="<?php echo esc_url( $prssa_favicon ); ?>">
    21         <?php endif; ?>
    2215
    2316        <?php wp_head(); ?>
    … …  
    6760                                <div class="site-branding">
    6861
    69                                 <?php
    70                                 // =========================================
    71                                 // CUSTOM LOGO (Customizer prssa_header_logo)
    72                                 // =========================================
    73                                 $header_logo = get_theme_mod( 'prssa_header_logo', '' );
     62                                <?php the_custom_logo(); ?>
    7463
    75                                 // Logo width & height customizer
    76                                 $logo_width  = absint( get_theme_mod( 'prssa_logo_width', 0 ) );
    77                                 $logo_height = absint( get_theme_mod( 'prssa_logo_height', 0 ) );
    78 
    79                                 $logo_styles = array();
    80 
    81                                 if ( $logo_width ) {
    82                                         $logo_styles[] = 'width:' . $logo_width . 'px';
    83                                         $logo_styles[] = 'max-width:' . $logo_width . 'px';
    84                                 }
    85 
    86                                 if ( $logo_height ) {
    87                                         $logo_styles[] = 'height:' . $logo_height . 'px';
    88                                         $logo_styles[] = 'max-height:' . $logo_height . 'px';
    89                                 }
    90 
    91                                 $logo_style_attr = $logo_styles ? ' style="' . esc_attr( implode( ';', $logo_styles ) ) . '"' : '';
    92 
    93                                 // Show customizer logo if exists
    94                                 if ( $header_logo ) :
    95                                 ?>
    96                                         <a href="<?php echo esc_url( home_url( '/' ) ); ?>" class="custom-logo-link" rel="home">
    97                                                 <img src="<?php echo esc_url( $header_logo ); ?>" alt="<?php bloginfo( 'name' ); ?>"<?php echo $logo_style_attr; ?>>
    98                                         </a>
    99                                 <?php
    100                                 else :
    101                                         // Fallback: default WP logo
    102                                         the_custom_logo();
    103                                 endif;
    104                                 ?>
    105 
    106 
    107                                 <?php
    108                                 // =========================================
    109                                 // SITE TITLE (Customizer: prssa_site_title)
    110                                 // =========================================
    111                                 $site_title = get_theme_mod( 'prssa_site_title', get_bloginfo( 'name' ) );
    112                                 ?>
    11364                                <?php if ( is_front_page() && is_home() ) : ?>
    114                                         <h1 class="site-title">
    115                                                 <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
    116                                                         <?php echo esc_html( $site_title ); ?>
    117                                                 </a>
    118                                         </h1>
     65                                        <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
    11966                                <?php else : ?>
    120                                         <p class="site-title">
    121                                                 <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
    122                                                         <?php echo esc_html( $site_title ); ?>
    123                                                 </a>
    124                                         </p>
     67                                        <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
    12568                                <?php endif; ?>
    12669
    127 
    128                                 <?php
    129                                 // =========================================
    130                                 // SITE TAGLINE (Customizer: prssa_site_des)
    131                                 // =========================================
    132                                 $site_desc = get_theme_mod( 'prssa_site_des', get_bloginfo( 'description' ) );
    133 
    134                                 if ( $site_desc || is_customize_preview() ) :
    135                                 ?>
    136                                         <p class="site-description"><?php echo esc_html( $site_desc ); ?></p>
     70                                <?php if ( get_bloginfo( 'description', 'display' ) || is_customize_preview() ) : ?>
     71                                        <p class="site-description"><?php bloginfo( 'description' ); ?></p>
    13772                                <?php endif; ?>
    13873
  • pressora/1.0.11/inc/customizer.php

    r349173 r356259  
    1919
    2020    //
    21     // GENERAL SECTION
    22     //
    23     $wp_customize->add_section( 'prssa_general_section', array(
    24         'title'    => __( 'General', 'pressora' ),
    25         'panel'    => 'prssa_theme_panel',
    26         'priority' => 10,
    27     ) );
    28 
    29     $wp_customize->add_setting( 'prssa_site_title', array(
    30         'default'           => '',
    31         'sanitize_callback' => 'sanitize_text_field',
    32         'transport'         => 'refresh',
    33     ) );
    34     $wp_customize->add_control( 'prssa_site_title', array(
    35         'label'   => __( 'Site Title', 'pressora' ),
    36         'section' => 'prssa_general_section',
    37         'type'    => 'text',
    38     ) );
    39 
    40     $wp_customize->add_setting( 'prssa_site_des', array(
    41         'default'           => '',
    42         'sanitize_callback' => 'sanitize_textarea_field',
    43         'transport'         => 'refresh',
    44     ) );
    45     $wp_customize->add_control( 'prssa_site_des', array(
    46         'label'   => __( 'Site Description', 'pressora' ),
    47         'section' => 'prssa_general_section',
    48         'type'    => 'textarea',
    49     ) );
    50 
    51     // Favicon (favicon should normally be added via Site Identity; still we provide one)
    52     $wp_customize->add_setting( 'prssa_header_favicon', array(
    53         'default'           => '',
    54         'sanitize_callback' => 'esc_url_raw',
    55         'transport'         => 'refresh',
    56     ) );
    57     $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'prssa_header_favicon', array(
    58         'label'    => __( 'Favicon', 'pressora' ),
    59         'section'  => 'prssa_general_section',
    60         'settings' => 'prssa_header_favicon',
    61     ) ) );
    62 
    63     //
    6421    // HEADER SECTION
    6522    //
    … …  
    6926        'priority' => 20,
    7027    ) );
    71 
    72     $wp_customize->add_setting( 'prssa_header_logo', array(
    73         'default'           => '',
    74         'sanitize_callback' => 'esc_url_raw',
    75         'transport'         => 'refresh',
    76     ) );
    77     $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'prssa_header_logo', array(
    78         'label'    => __( 'Header Logo', 'pressora' ),
    79         'section'  => 'prssa_header_section',
    80         'settings' => 'prssa_header_logo',
    81     ) ) );
    8228
    8329    $wp_customize->add_setting( 'prssa_header_contact', array(
    … …  
    9945    ) );
    10046    $wp_customize->add_control( 'prssa_logo_width', array(
    101         'label'   => __( 'Logo Width (px)', 'pressora' ),
    102         'section' => 'prssa_header_section',
    103         'type'    => 'number',
     47        'label'       => __( 'Logo Width (px)', 'pressora' ),
     48        'description' => __( 'Optional display size for the logo set in Site Identity.', 'pressora' ),
     49        'section'     => 'prssa_header_section',
     50        'type'        => 'number',
    10451        'input_attrs' => array( 'min' => 0, 'step' => 1 ),
    10552    ) );
    … …  
    11158    ) );
    11259    $wp_customize->add_control( 'prssa_logo_height', array(
    113         'label'   => __( 'Logo Height (px)', 'pressora' ),
    114         'section' => 'prssa_header_section',
    115         'type'    => 'number',
     60        'label'       => __( 'Logo Height (px)', 'pressora' ),
     61        'description' => __( 'Optional display size for the logo set in Site Identity.', 'pressora' ),
     62        'section'     => 'prssa_header_section',
     63        'type'        => 'number',
    11664        'input_attrs' => array( 'min' => 0, 'step' => 1 ),
    11765    ) );
    … …  
    373321        ),
    374322    ) );
     323
     324    /*
     325     * Site Title, Tagline, and header text color are WordPress core settings.
     326     * Enable live preview for the markup this theme already prints.
     327     */
     328    $wp_customize->get_setting( 'blogname' )->transport        = 'postMessage';
     329    $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
     330
     331    if ( $wp_customize->get_setting( 'header_textcolor' ) ) {
     332        $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
     333    }
     334
     335    if ( isset( $wp_customize->selective_refresh ) ) {
     336        $wp_customize->selective_refresh->add_partial(
     337            'blogname',
     338            array(
     339                'selector'        => '.site-title a',
     340                'render_callback' => 'prssa_customize_partial_blogname',
     341            )
     342        );
     343        $wp_customize->selective_refresh->add_partial(
     344            'blogdescription',
     345            array(
     346                'selector'        => '.site-description',
     347                'render_callback' => 'prssa_customize_partial_blogdescription',
     348            )
     349        );
     350    }
    375351}
    376352add_action( 'customize_register', 'prssa_customize_register' );
     353
     354/**
     355 * Render the site title for the Customizer selective refresh partial.
     356 */
     357function prssa_customize_partial_blogname() {
     358    bloginfo( 'name' );
     359}
     360
     361/**
     362 * Render the site tagline for the Customizer selective refresh partial.
     363 */
     364function prssa_customize_partial_blogdescription() {
     365    bloginfo( 'description' );
     366}
     367
     368/**
     369 * Apply optional logo dimensions to the core Custom Logo image.
     370 *
     371 * @param array $attr Image attributes.
     372 * @return array
     373 */
     374function prssa_custom_logo_image_attributes( $attr ) {
     375    $logo_width  = absint( get_theme_mod( 'prssa_logo_width', 0 ) );
     376    $logo_height = absint( get_theme_mod( 'prssa_logo_height', 0 ) );
     377    $styles      = array();
     378
     379    if ( $logo_width ) {
     380        $styles[] = 'width:' . $logo_width . 'px';
     381        $styles[] = 'max-width:' . $logo_width . 'px';
     382    }
     383
     384    if ( $logo_height ) {
     385        $styles[] = 'height:' . $logo_height . 'px';
     386        $styles[] = 'max-height:' . $logo_height . 'px';
     387    }
     388
     389    if ( $styles ) {
     390        $attr['style'] = implode( ';', $styles );
     391    }
     392
     393    return $attr;
     394}
     395add_filter( 'get_custom_logo_image_attributes', 'prssa_custom_logo_image_attributes' );
    377396
    378397
  • pressora/1.0.11/languages/pressora.pot

    r352897 r356259  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Pressora 1.0.10\n"
     5"Project-Id-Version: Pressora 1.0.11\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/theme/pressora\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    … …  
    157157
    158158#: inc/customizer.php:24
    159 msgid "General"
     159#: inc/customizer.php:318
     160msgid "Header"
    160161msgstr ""
    161162
    162163#: inc/customizer.php:35
    163 msgid "Site Title"
    164 msgstr ""
    165 
    166 #: inc/customizer.php:46
    167 msgid "Site Description"
    168 msgstr ""
    169 
    170 #: inc/customizer.php:58
    171 msgid "Favicon"
    172 msgstr ""
    173 
    174 #: inc/customizer.php:370
    175 #: inc/customizer.php:67
    176 msgid "Header"
    177 msgstr ""
    178 
    179 #: inc/customizer.php:78
    180 msgid "Header Logo"
    181 msgstr ""
    182 
    183 #: inc/customizer.php:89
    184164msgid "Header Contact"
    185165msgstr ""
    186166
    187 #: inc/customizer.php:90
     167#: inc/customizer.php:36
    188168msgid "Phone, email, or short contact text displayed in the header."
    189169msgstr ""
    190170
    191 #: inc/customizer.php:101
     171#: inc/customizer.php:47
    192172msgid "Logo Width (px)"
    193173msgstr ""
    194174
    195 #: inc/customizer.php:113
     175#: inc/customizer.php:48
     176#: inc/customizer.php:61
     177msgid "Optional display size for the logo set in Site Identity."
     178msgstr ""
     179
     180#: inc/customizer.php:60
    196181msgid "Logo Height (px)"
    197182msgstr ""
  • pressora/1.0.11/readme.txt

    r352897 r356259  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 1.0.10
     7Stable tag: 1.0.11
    88License: GNU General Public License v2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    4848== Changelog ==
    4949
     50= 1.0.11 =
     51* Fixed wp org team changes
     52
    5053= 1.0.10 =
    5154* Show the full mobile menu instead of a clipped strip beside the toggle.
  • pressora/1.0.11/style.css

    r352897 r356259  
    55Author URI: https://profiles.wordpress.org/solankisoftware/
    66Description: Pressora is a free news magazine WordPress theme for newspapers, magazines, and editorial sites. It focuses on a clean headline layout, category labels, featured stories, and readable typography without plugin-style features.
    7 Version: 1.0.10
     7Version: 1.0.11
    88Tested up to: 7.1
    99Requires PHP: 7.4
Note: See TracChangeset for help on using the changeset viewer.