ibeats
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Requiring a User to be Logged in to view a pageYou could password protect the page. I don’t like this feature of WP and don’t advise using it, but it’s easy to do. In any case you asked how how to construct a template to do this, not how to do this in general.
@bcworkzI too don’t like this as its a static password etc…. Also, the plugin I’m using doesnt really support this ??
If you use a classic theme, you could build the logic directly into a page template using PHP.
@bcworkzThis is what I’m used to, but I cannot fathom out how to achieve this in the modern block theme method. You’re further comment about building a pattern might be something I can play with. Ill have a look – thanks!
Sorry — hope this helps.
TwentyTwentyfour, Post.
TwentyTwentyfour, Club Page – Default Template.
Yup, that looks like it’s fixed it – great work. Thank you!
Hi Savvas, it’s a shortcode within my page template;
<!-- wp:shortcode -->
[countdown team="171" show_venue="0" show_league="0" align="none"]
<!-- /wp:shortcode --></div>full template.
<!-- wp:template-part {"slug":"header","theme":"site-child","tagName":"header"} /-->
<!-- wp:group {"tagName":"main","style":{"spacing":{"margin":{"top":"0px","bottom":"0px"}}},"layout":{"type":"default"}} -->
<main class="wp-block-group" style="margin-top:0px;margin-bottom:0px"><!-- wp:group {"style":{"spacing":{"padding":{"top":"25px","right":"25px","bottom":"25px","left":"25px"}}},"backgroundColor":"custom-footer-blue","layout":{"type":"constrained"}} -->
<div class="wp-block-group has-custom-footer-blue-background-color has-background" style="padding-top:25px;padding-right:25px;padding-bottom:25px;padding-left:25px"><!-- wp:group {"align":"wide","layout":{"type":"default"}} -->
<div class="wp-block-group alignwide"><!-- wp:post-title {"textColor":"white","fontSize":"extra-large"} /--></div>
<!-- /wp:group --></div>
<!-- /wp:group -->
<!-- wp:group {"style":{"spacing":{"margin":{"top":"0px","bottom":"0px"},"padding":{"top":"60px","right":"20px","bottom":"40px","left":"20px"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group" style="margin-top:0px;margin-bottom:0px;padding-top:60px;padding-right:20px;padding-bottom:40px;padding-left:20px"><!-- wp:group {"align":"wide","layout":{"type":"default"}} -->
<div class="wp-block-group alignwide"><!-- wp:columns -->
<div class="wp-block-columns"><!-- wp:column {"width":"70%"} -->
<div class="wp-block-column" style="flex-basis:70%"><!-- wp:post-content /-->
<!-- wp:group {"layout":{"type":"flex","flexWrap":"wrap","justifyContent":"space-between"}} -->
<div class="wp-block-group"><!-- wp:post-navigation-link {"type":"previous","showTitle":true,"fontSize":"medium"} /-->
<!-- wp:post-navigation-link {"showTitle":true,"fontSize":"medium"} /--></div>
<!-- /wp:group -->
<!-- wp:comments -->
<div class="wp-block-comments"><!-- wp:comments-title /-->
<!-- wp:comment-template -->
<!-- wp:columns -->
<div class="wp-block-columns"><!-- wp:column {"width":"40px"} -->
<div class="wp-block-column" style="flex-basis:40px"><!-- wp:avatar {"size":40,"style":{"border":{"radius":"20px"}}} /--></div>
<!-- /wp:column -->
<!-- wp:column -->
<div class="wp-block-column"><!-- wp:comment-author-name {"fontSize":"small"} /-->
<!-- wp:group {"style":{"spacing":{"margin":{"top":"0px","bottom":"0px"}}},"layout":{"type":"flex"}} -->
<div class="wp-block-group" style="margin-top:0px;margin-bottom:0px"><!-- wp:comment-date {"fontSize":"small"} /-->
<!-- wp:comment-edit-link {"fontSize":"small"} /--></div>
<!-- /wp:group -->
<!-- wp:comment-content /-->
<!-- wp:comment-reply-link {"fontSize":"small"} /--></div>
<!-- /wp:column --></div>
<!-- /wp:columns -->
<!-- /wp:comment-template -->
<!-- wp:comments-pagination -->
<!-- wp:comments-pagination-previous /-->
<!-- wp:comments-pagination-numbers /-->
<!-- wp:comments-pagination-next /-->
<!-- /wp:comments-pagination -->
<!-- wp:post-comments-form /--></div>
<!-- /wp:comments --></div>
<!-- /wp:column -->
<!-- wp:column {"width":"30%"} -->
<div class="wp-block-column" style="flex-basis:30%"><!-- wp:group {"tagName":"main","style":{"spacing":{"margin":{"top":"0px","bottom":"0px"}}},"layout":{"type":"default"}} -->
<main class="wp-block-group" style="margin-top:0px;margin-bottom:0px"><!-- wp:group {"align":"wide","layout":{"type":"default"}} -->
<div class="wp-block-group alignwide"><!-- wp:group {"style":{"spacing":{"padding":{"top":"20px","right":"20px","bottom":"20px","left":"20px"}}},"backgroundColor":"section-bg","layout":{"type":"constrained"}} -->
<div class="wp-block-group has-section-bg-background-color has-background" style="padding-top:20px;padding-right:20px;padding-bottom:20px;padding-left:20px"><!-- wp:group {"style":{"border":{"bottom":{"color":"var:preset|color|primary","width":"2px"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group" style="border-bottom-color:var(--wp--preset--color--primary);border-bottom-width:2px"><!-- wp:heading {"level":3,"style":{"typography":{"letterSpacing":"1px"},"spacing":{"margin":{"bottom":"10px"}}}} -->
<h3 class="wp-block-heading" style="margin-bottom:10px;letter-spacing:1px">Sponsors</h3>
<!-- /wp:heading --></div>
<!-- /wp:group -->
<!-- wp:image {"lightbox":{"enabled":false},"id":622,"sizeSlug":"full","linkDestination":"custom"} -->
<figure class="wp-block-image size-full"><a ><img src="https://site.co.uk/wp-content/uploads/2024/08/U7-2425-SponsorLogo-site-1.png" alt="https://siteltd.co.uk" class="wp-image-622"/></a></figure>
<!-- /wp:image --></div>
<!-- /wp:group -->
<!-- wp:group {"style":{"spacing":{"padding":{"top":"20px","right":"20px","bottom":"20px","left":"20px"}}},"backgroundColor":"section-bg","layout":{"type":"constrained"}} -->
<div class="wp-block-group has-section-bg-background-color has-background" style="padding-top:20px;padding-right:20px;padding-bottom:20px;padding-left:20px"><!-- wp:group {"style":{"border":{"bottom":{"color":"var:preset|color|primary","width":"2px"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group" style="border-bottom-color:var(--wp--preset--color--primary);border-bottom-width:2px"><!-- wp:heading {"level":3,"style":{"typography":{"letterSpacing":"1px"},"spacing":{"margin":{"bottom":"10px"}}}} -->
<h3 class="wp-block-heading" style="margin-bottom:10px;letter-spacing:1px">Next Game</h3>
<!-- /wp:heading --></div>
<!-- /wp:group -->
<!-- wp:shortcode -->
[countdown team="171" show_venue="0" show_league="0" align="none"]
<!-- /wp:shortcode --></div>
<!-- /wp:group -->
<!-- wp:group {"style":{"spacing":{"padding":{"top":"20px","right":"20px","bottom":"20px","left":"20px"}}},"backgroundColor":"section-bg","layout":{"type":"constrained"}} -->
<div class="wp-block-group has-section-bg-background-color has-background" style="padding-top:20px;padding-right:20px;padding-bottom:20px;padding-left:20px"><!-- wp:group {"style":{"border":{"bottom":{"color":"var:preset|color|primary","width":"2px"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group" style="border-bottom-color:var(--wp--preset--color--primary);border-bottom-width:2px"><!-- wp:heading {"level":3,"style":{"typography":{"letterSpacing":"1px"},"spacing":{"margin":{"bottom":"10px"}}}} -->
<h3 class="wp-block-heading" style="margin-bottom:10px;letter-spacing:1px">Latest Result</h3>
<!-- /wp:heading --></div>
<!-- /wp:group -->
<!-- wp:shortcode -->
[event_blocks class="sp-table-caption" team="171" league="0" season="0" venue="0" status="publish" format="default" date="0" date_from="" date_to="1" date_past="14" date_future="1" date_relative="0" day="" number="1" orderby="date" order="DESC" show_all_events_link="0" align="none"]
<!-- /wp:shortcode --></div>
<!-- /wp:group -->
<!-- wp:group {"style":{"spacing":{"padding":{"top":"20px","right":"20px","bottom":"20px","left":"20px"}}},"backgroundColor":"section-bg","layout":{"type":"constrained"}} -->
<div class="wp-block-group has-section-bg-background-color has-background" style="padding-top:20px;padding-right:20px;padding-bottom:20px;padding-left:20px"><!-- wp:group {"style":{"border":{"bottom":{"color":"var:preset|color|primary","width":"2px"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group" style="border-bottom-color:var(--wp--preset--color--primary);border-bottom-width:2px"><!-- wp:heading {"level":3,"style":{"typography":{"letterSpacing":"1px"},"spacing":{"margin":{"bottom":"10px"}}}} -->
<h3 class="wp-block-heading" style="margin-bottom:10px;letter-spacing:1px">Calendar</h3>
<!-- /wp:heading --></div>
<!-- /wp:group -->
<!-- wp:shortcode -->
[event_calendar id="429" team="171" show_all_events_link="1"]
<!-- /wp:shortcode --></div>
<!-- /wp:group --></div>
<!-- /wp:group --></main>
<!-- /wp:group --></div>
<!-- /wp:column --></div>
<!-- /wp:columns --></div>
<!-- /wp:group --></div>
<!-- /wp:group --></main>
<!-- /wp:group -->
<!-- wp:template-part {"slug":"footer","theme":"site-child","tagName":"footer"} /-->Sorry, I sent you the wrong error code. I had tried what you said… this is the error when I just have vanilla SportsPress on twentytwenty.
PHP Warning: ?Undefined variable $calendar in /wp-content/plugins/sportspress/templates/countdown.php on line 45
Thanks again @savvasha… in relation to “copying” core plugin components to a child theme… does this only apply to template components of a plugin, or for example, can the “includes” components also be copied to the child for modification?
For example, root/wp-content/plugins/sportspress/includes/sp-template-hooks.php, where would this be copied to, in a child theme for manipulation?
I’ve tried root/wp-content/themes/theme-child/sportspress/includes/sp-template-hooks.php and also root/wp-content/themes/theme-child/sportspress/sp-template-hooks.php to no avail ??
Do core components not work like that?
- This reply was modified 7 months ago by ibeats.
Thank you for your rapid response @savvasha! No such luck – though my brain is fried, its Friday after all ??
function sportspress_the_title( $title, $id = null ) {
if ( ! $id ) {
return $title;
}
if ( ! is_admin() && in_the_loop() && $id == get_the_ID() ) :
if ( is_singular( 'sp_player' ) ) :
$number = get_post_meta( $id, 'sp_number', true );
$current_team = get_post_meta( $id, 'sp_current_team', true );
$team_name = get_post_title( $current_team );
$url = get_post_meta( $id, 'sp_url', true );
if ( $number != null ) :
$title = '<strong class="sp-player-number">' . $number . '</strong> ' . $title . ' | ' . '<a href="' . $url . '">' . $team_name . '</a>';
endif;
elseif ( is_singular( 'sp_staff' ) ) :
$staff = new SP_Staff( $id );
$role = $staff->role();
if ( $role ) {
$title = '<strong class="sp-staff-role">' . $role->name . '</strong> ' . $title;
}
endif;
endif;
return $title;
}
add_filter( 'the_title', 'sportspress_the_title', 10, 2 );$current_team = get_post_meta( $id, ‘sp_current_team’, true ); correctly returns the Team ID, but I cannot get the Team Name from that :S
Forum: Themes and Templates
In reply to: Styling get_category… Splitting it…Close, but not quite, though I guess It’s me that’s not doing the right thing…
Take a look at the bottom here; https://www.ibeats.co.uk/ (4,6,7 in Other News) show two categories but are only taking the styling of the first ??
Forum: Plugins
In reply to: Plugin to handle a soccer teamAlso looking!
Vini
Sheffield Squeelers
https://www.squeelers.co.ukxdream1328, sounds like you did exactly the same as me. I’ve just today backed up my 4.0 db and dropped it into 4.1, i deleted the tables I created, disabled the plugin and have just reactivated it.
this time round it’s created the tables automatically, and im just rebuilding.
i’m guessing, i say guessing, the creator’s commented suggesting 4.1, that this plugin won’t work under anything less.
sure enough, my caching has just completed, and all is now working!
good job M!
aha, no it’s only 4.0 – is that my problem?
Is there an easy way to upgrade to 4.1+?
I’ve a similar problem, with a fresh install, of 3.06 on WP 2.8.
I figured it was because the SQL tables weren’t setup on Activating the plugin. Sure enough, they weren’t so I tried to set them up following the SQL Manual Install guide here.
Unfortunately, the syntax there gives errors when trying to run the SQL code.
I’m guessing without the tables, YARPP won’t work.
How can I setup the tables?
I also tried the latest BETA, but still no joy.
Forum: Fixing WordPress
In reply to: Use tags elsewhere?Can’t get that to work Abelito ??
Forum: Fixing WordPress
In reply to: Use tags elsewhere?I’m also trying to achieve this. Am i right in thinking $authordata is globally set by default/activation of the plugin?
by using
<?php userphoto_the_author_photo(); ?>
I can see the user photo, however, the same userphoto exists for all my users.I wish to achieve the same as HNYC and display the photo relative to the signed in user.
Forum: Plugins
In reply to: Calling a function outside of WP<?php require ('/home/jamesv/public_html/wordpress/wp-content/plugins/customizable-post-listings.php');?>
didnt work, when used with:
<h3>Other Headlines</h3>
<div class="itemside">
<?php c2c_get_recent_posts ($num_posts = 10,
$format = "<a href=\"/?p=%post_id%\">%post_title%</a><br>",
$categories = '',
$orderby = 'date',
$order = 'DESC',
$offset = 5,
$authors = '',
$include_passworded_posts = false); ?>
</div>?? ??