ikaring
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: display custom post based on titleUmm.
I just wonder if result-athlete field value is text field and input text is same format as title of athlete post.I might do the following things in this situation
1. set WP_DEBUG to true in wp-config.php to see if there are any errors.
define('WP_DEBUG', false);2.check if right template file is used for the page, using plugin like Show Current Template.
https://ja.wordpress.org/plugins/show-current-template/3.check the input value for the custom field and title field.
( Is result-athlete field a text field or radio button? )4.var_dump queried data to see actual data.
$the_query = new WP_Query( $args ); var_dump( $the_query );5.change some parameters to see the difference, like set
'compare' => 'like'
or even'compare' => '!=' or delete some parameters to get it simple.Hope that helps.
Forum: Fixing WordPress
In reply to: display custom post based on titleI think I found the cause. When using meta_query, use ‘key’ and ‘value’ instead of ‘meta_key’ and ‘meta_value’.
'meta_query' => array( array( 'key' => 'result-athlete', 'value' => $athlete, 'compare' => '=' ) )Since only one custom field value is concerned, meta_query is not necessory.
Above part can be replaced with only meta_key and meta_value parameter like so'meta_key' => 'result-athlete', 'meta_value' => $athlete,Forum: Fixing WordPress
In reply to: display custom post based on titleVariables ( like $paged or $athlete ) should be defined before it is used like so.
$athlete = wp_title( '', false); $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1; $args = array( ...As for $paged, it is explained in Codex: Pagination Parameters section of WP_Query page.
http://codex.wordpress.org/Class_Reference/WP_Query#Pagination_Parameters
meta_query is also in the same page, Custom Field Parameters section.
Codex is the best place to learn WordPress.Forum: Fixing WordPress
In reply to: Menu icon not clickable on iphoneGood 🙂
Forum: Fixing WordPress
In reply to: Complete post is not opening like pagesDoes your theme has single.php or singular.php for displaying single posts?
https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
You can check which template file/files are used for the page with Show Current Template plugin.
https://wordpress.org/plugins/show-current-template/Forum: Fixing WordPress
In reply to: display custom post based on titleAh have you set $paged?
$paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;Forum: Fixing WordPress
In reply to: display custom post based on titleIt seems fine. Just check to see if $athlete value is exactly same as result-athlete field value.
$athlete = wp_title( '', false); var_dump( $athlete );Which template file is these code written? Is it single-profile.php or single-athlete.php?
Forum: Fixing WordPress
In reply to: Menu icon not clickable on iphoneThis is because markup of navigation does not fit to navigation.js script.
nav-horizontal class should be put on ul element, instead of wrapper div.
I dont know if that is theme bug or your menu setting.<div class="nav-horizontal"> <ul> <li class="page_item page-item-5 current_page_item"><a href="http://evenergisingsolutions.co.uk/">Home</a></li> ... </ul> </div>Forum: Fixing WordPress
In reply to: Error: Tracking is not enabled for this websiteThat alert seems to be generated by ChatWidget.js, though I dont know anything about the widget.
Forum: Fixing WordPress
In reply to: display custom post based on titleYou can learn tags in Codex. Pls check them.
https://developer.wordpress.org/reference/functions/wp_title/
wp_title( '', false )means no separate string and just get the title text instead of displaying it on screen.Forum: Fixing WordPress
In reply to: display custom post based on titleIt can be anywhere before its been used, like so:
$current_title = wp_title( '', false ); $args = array( ...., meta_value' => $current_title, );Forum: Fixing WordPress
In reply to: display custom post based on titleYou can set meta_key and meta_value as follows:
$args = array( 'post_type' => 'result', 'category_name' => 'current_athlete', 'orderby' => 'date', 'order' => 'ASC', 'posts_per_page' => 15, 'paged' => $paged, 'meta_key' => 'result-athlete', 'meta_value' => $current_title,// should be defined beforehand );And delete the if clause:
<?php if (the_field('result-athlete') == $current_title ); ?>Forum: Localhost Installs
In reply to: Problem in Step 4 installing Worpress lcoally on Mac with MampI thing you need to add a slash.
http://localhost:8889/Wordpress/Forum: Fixing WordPress
In reply to: "mailto:" error on blog postsThat box has a class name “fusion-sharing-box”, and that css rule is set in parent theme(Avada theme)’s style.css.
This means it is a part of Avada theme. So it is likely that the theme template defines the output.
Or it might be a widget, it might be theme customizer setting…Forum: Fixing WordPress
In reply to: "mailto:" error on blog postsYou need e-mail address after “mailto:” on href attribute for mail icon link, which is located above comment form.