updated and cleaned up php files. added support to load latest style sheet from url
This commit is contained in:
parent
0b911426ae
commit
2abc3d6213
505
adminstyles.css
505
adminstyles.css
File diff suppressed because it is too large
Load Diff
|
@ -1,106 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* The template for displaying archive custom post type ajut
|
|
||||||
*
|
|
||||||
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
|
|
||||||
*
|
|
||||||
* @package Oficina_de_Suport_theme
|
|
||||||
*/
|
|
||||||
|
|
||||||
get_header();
|
|
||||||
?>
|
|
||||||
|
|
||||||
<main id="primary" class="site-main">
|
|
||||||
|
|
||||||
<section id="filteredfunds" class="ofisuport-filtered-funds ofisuport-ajuts-filtrats">
|
|
||||||
|
|
||||||
<aside id="fundsfilter" class="ofisuport-filter-funds ofisuport-fitre-ajuts">
|
|
||||||
|
|
||||||
<div id="arhive-filters" class="ofisuport-filters">
|
|
||||||
<?php
|
|
||||||
// output all possible values of a checkbox
|
|
||||||
$groupkey = "group_63ab636898703"; // write here the key for the group of fields from acf
|
|
||||||
if( $groupkey){
|
|
||||||
//echo '<h6>check the groupkey <span style="color: #00b">' . $groupkey . '</span></h6>';
|
|
||||||
$groupkey_fields = acf_get_fields($groupkey);
|
|
||||||
foreach( $groupkey_fields as $field_key ) {
|
|
||||||
if( $field_key['type'] == 'checkbox' ){
|
|
||||||
//echo '<span style="color: #00b">' . ($field_key['key']) . '</span><br/>';
|
|
||||||
//echo '<span style="color: #00b">' . ($field_key['label']) . '</span><br/>';
|
|
||||||
//echo '<span style="color: #00b">' . ($field_key['name']) . '</span><br/>';
|
|
||||||
// https://wordpress.stackexchange.com/a/102915
|
|
||||||
//$field_key = "field_XXXXXX";// the acf field key unic numbers
|
|
||||||
$field_key = $field_key['key'];
|
|
||||||
$fields = get_field_object($field_key);
|
|
||||||
|
|
||||||
if( $fields )
|
|
||||||
{
|
|
||||||
// check for values in url
|
|
||||||
foreach( $GLOBALS['my_query_filters'] as $key => $fieldname ):
|
|
||||||
|
|
||||||
// set value if available
|
|
||||||
if( isset($_GET[ $fieldname ]) ) {
|
|
||||||
|
|
||||||
$filteredvalues['value'] = explode(',', $_GET[ $fieldname ]);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
// construct the checkboxes
|
|
||||||
if( $fieldname == $fields['name']) {
|
|
||||||
echo '<nav id="fund-filter" class="ofisuport-filter ' . $fields['name'] . '">' ;
|
|
||||||
echo '<h5>' . $fields['label'] . '</h5>';
|
|
||||||
echo '<ul>';
|
|
||||||
|
|
||||||
foreach( $fields['choices'] as $choicevalue => $choicelabel ) {
|
|
||||||
echo '<li>';
|
|
||||||
echo '<input type="checkbox" ';
|
|
||||||
echo ' value="' . $choicevalue . '" ';
|
|
||||||
if( in_array($choicevalue,$filteredvalues['value']) ):
|
|
||||||
echo ' checked="checked" ';
|
|
||||||
endif;
|
|
||||||
echo ' />';
|
|
||||||
echo $choicelabel;
|
|
||||||
echo '</li>';
|
|
||||||
}
|
|
||||||
echo '</ul>';
|
|
||||||
echo '</nav>';
|
|
||||||
};
|
|
||||||
// end of construct checkboxes
|
|
||||||
|
|
||||||
endforeach;
|
|
||||||
// end check for values in url
|
|
||||||
}
|
|
||||||
};//end if type checkbox
|
|
||||||
};//end foreach groupkey field
|
|
||||||
};//end if groupkey
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?php //endforeach; ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</aside>
|
|
||||||
|
|
||||||
<content class="archive-posts <?php ofisuport_class_posttype(); ?>">
|
|
||||||
|
|
||||||
<?php if ( have_posts() ) : ?>
|
|
||||||
<?php while ( have_posts() ) : the_post();
|
|
||||||
|
|
||||||
get_template_part( 'template-parts/section', 'eachpost' );
|
|
||||||
|
|
||||||
endwhile;
|
|
||||||
|
|
||||||
|
|
||||||
else :
|
|
||||||
|
|
||||||
get_template_part( 'template-parts/content', 'none' );
|
|
||||||
|
|
||||||
endif;
|
|
||||||
?>
|
|
||||||
|
|
||||||
</content>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
</main><!-- #main -->
|
|
||||||
|
|
||||||
<?php
|
|
||||||
get_footer();
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* The template for displaying archive custom post type ajut
|
* The template for displaying archive custom post type ofisuport-ajut
|
||||||
*
|
*
|
||||||
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
|
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
|
||||||
*
|
*
|
||||||
|
@ -12,11 +12,11 @@ get_header();
|
||||||
|
|
||||||
<main id="primary" class="site-main">
|
<main id="primary" class="site-main">
|
||||||
<?php
|
<?php
|
||||||
// Detect plugin. For use on Front End only.
|
// Detect plugin. For use on Front End only.
|
||||||
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
||||||
// check for plugin using plugin name
|
// check for plugin using plugin name
|
||||||
if ( is_plugin_active( 'oficinasuport-wp-plugin/ofisuport-wp-plugin.php' ) ) {
|
if ( is_plugin_active( 'oficinasuport-wp-plugin/ofisuport-wp-plugin.php' ) ) {
|
||||||
//plugin is activated do
|
//plugin is activated do
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<section id="filteredfunds" class="ofisuport-filtered-funds ofisuport-ajuts-filtrats">
|
<section id="filteredfunds" class="ofisuport-filtered-funds ofisuport-ajuts-filtrats">
|
||||||
|
|
|
@ -14,12 +14,12 @@
|
||||||
<footer id="colophon" class="site-footer">
|
<footer id="colophon" class="site-footer">
|
||||||
<div class="site-info">
|
<div class="site-info">
|
||||||
<?php dynamic_sidebar( 'footer' ); ?>
|
<?php dynamic_sidebar( 'footer' ); ?>
|
||||||
<!--a href="<?php //echo esc_url( __( 'https://wordpress.org/', 'ofisuport' ) ); ?>">
|
<?php //echo '<a href="' . esc_url( __( 'https://wordpress.org/', 'ofisuport' ) ) . '">'; ?>
|
||||||
<?php
|
<?php
|
||||||
/* translators: %s: CMS name, i.e. WordPress. */
|
/* translators: %s: CMS name, i.e. WordPress. */
|
||||||
//printf( esc_html__( 'Proudly powered by %s', 'ofisuport' ), 'WordPress' );
|
//printf( esc_html__( 'Proudly powered by %s', 'ofisuport' ), 'WordPress' );
|
||||||
?>
|
?>
|
||||||
</a-->
|
<?php //echo '</a>'; ?>
|
||||||
<!--span class="sep"></span-->
|
<!--span class="sep"></span-->
|
||||||
<?php
|
<?php
|
||||||
/* translators: 1: Theme name, 2: Theme author. */
|
/* translators: 1: Theme name, 2: Theme author. */
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
if ( ! defined( '_S_VERSION' ) ) {
|
if ( ! defined( '_S_VERSION' ) ) {
|
||||||
// Replace the version number of the theme on each release.
|
// Replace the version number of the theme on each release.
|
||||||
define( '_S_VERSION', '1.0.0' );
|
define( '_S_VERSION', '1.0.1' );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -128,7 +128,10 @@ require get_template_directory() . '/inc/widgets-register.php';
|
||||||
* Enqueue scripts and styles.
|
* Enqueue scripts and styles.
|
||||||
*/
|
*/
|
||||||
function ofisuport_scripts() {
|
function ofisuport_scripts() {
|
||||||
wp_enqueue_style( 'ofisuport-style', get_stylesheet_uri(), array(), _S_VERSION );
|
//wp_enqueue_style( 'ofisuport-style', get_stylesheet_uri(), array(), _S_VERSION );
|
||||||
|
//https://developer.wordpress.org/reference/functions/wp_enqueue_style/#comment-2056
|
||||||
|
//wp_enqueue_style('main-styles', get_template_directory_uri() . '/css/style.css', array(), filemtime(get_template_directory() . '/css/style.css'), false);
|
||||||
|
wp_enqueue_style( 'ofisuport-style', get_stylesheet_uri(), array(), filetime(get_stylesheet_uri() . 'style.css', false);
|
||||||
wp_style_add_data( 'ofisuport-style', 'rtl', 'replace' );
|
wp_style_add_data( 'ofisuport-style', 'rtl', 'replace' );
|
||||||
|
|
||||||
wp_enqueue_script( 'ofisuport-navigation', get_template_directory_uri() . '/js/navigation.js', array(), _S_VERSION, true );
|
wp_enqueue_script( 'ofisuport-navigation', get_template_directory_uri() . '/js/navigation.js', array(), _S_VERSION, true );
|
||||||
|
|
|
@ -1,22 +1,22 @@
|
||||||
/*
|
/*
|
||||||
|
|
||||||
Theme Name: Oficina de Suport theme
|
Theme Name: Espai Assessorament - XarxaProd.cat
|
||||||
Theme URI: http://underscores.me/
|
Theme URI: https://git.hangar.org/xarxaprod/
|
||||||
Author: jorge-vitrubio.net
|
Author: Hangar.org Tech Lab - hangar.org
|
||||||
Author URI: https://vitrubio.net
|
Author URI: https://hangar.org
|
||||||
Description: theme for the Oficina de Suport de Xarxaprod.cat
|
Description: theme for the Espai d'assessorament, projecte oficina de suport de <a href="https://xarxaprod.cat">XarxaProd</a>. Inclou la possibilitat de publicar, catalogar i cercar ajuts, resoldre dubtes amb FAQs i altres. Design by Eudald Van der Pla <a href="https://vanderpla.com">vanderpla.com</a>. Coding template and theme by <a href="https://vitrubio.net">Jorge - vitrubio.net</a>
|
||||||
Version: 1.0.0
|
Version: 1.0.2
|
||||||
Tested up to: 5.4
|
Tested up to: 6.2
|
||||||
Requires PHP: 5.6
|
Requires PHP: 5.6
|
||||||
License: GNU General Public License v2 or later
|
License: GNU General Public License v3 or later
|
||||||
License URI: LICENSE
|
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
||||||
Text Domain: ofisuport
|
Text Domain: ofisuport
|
||||||
Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
|
Tags: custom-logo, custom-menu, search,custom post-type, translation-ready
|
||||||
|
|
||||||
This theme, like WordPress, is licensed under the GPL.
|
This theme, like WordPress, is licensed under the GPL.
|
||||||
Use it to make something cool, have fun, and share what you've learned.
|
Use it to make something cool, have fun, and share what you've learned.
|
||||||
|
|
||||||
Oficina de Suport theme is based on Underscores https://underscores.me/, (C) 2012-2020 Automattic, Inc.
|
Epai d'Assessorament, projecte oficina de suport de la XarxaProd.cat theme is based on Underscores https://underscores.me/, (C) 2012-2020 Automattic, Inc.
|
||||||
Underscores is distributed under the terms of the GNU GPL v2 or later.
|
Underscores is distributed under the terms of the GNU GPL v2 or later.
|
||||||
|
|
||||||
Normalizing styles have been helped along thanks to the fine work of
|
Normalizing styles have been helped along thanks to the fine work of
|
||||||
|
|
11
single.php
11
single.php
|
@ -18,17 +18,6 @@ get_header();
|
||||||
|
|
||||||
get_template_part( 'template-parts/content', get_post_type() );
|
get_template_part( 'template-parts/content', get_post_type() );
|
||||||
|
|
||||||
//the_post_navigation(
|
|
||||||
// array(
|
|
||||||
// 'prev_text' => '<span class="nav-subtitle">' . esc_html__( 'Anterior:', 'ofisuport' ) . '</span> <span class="nav-title">%title</span>',
|
|
||||||
// 'next_text' => '<span class="nav-subtitle">' . esc_html__( 'Següent:', 'ofisuport' ) . '</span> <span class="nav-title">%title</span>',
|
|
||||||
// )
|
|
||||||
//);
|
|
||||||
|
|
||||||
// If comments are open or we have at least one comment, load up the comment template.
|
|
||||||
//if ( comments_open() || get_comments_number() ) :
|
|
||||||
// comments_template();
|
|
||||||
//endif;
|
|
||||||
|
|
||||||
endwhile; // End of the loop.
|
endwhile; // End of the loop.
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue