nazzilla
Forum Replies Created
-
Forum: Plugins
In reply to: [Multiple Featured Images] add as a background imageTry this:
<?php
$thumb = kdmfi_get_featured_image_src( ‘your-featured-image-id’, ‘full’, $post->ID ); ?>
then
<div class=”header-image parallax-background-image” data-stellar-ratio=”0.85″ style=”background-image: url(‘<?php echo $thumb;?>’)”>
<div class=”wrapper”>Forum: Hacks
In reply to: How to exclude tags via URL parameters?Try with this url structure
https://example.com?exclude=dogs,cat,fish
this code
$exclude_tags = explode(",", $_REQUEST['exclude']);; $exclude_tags_ids = array(); foreach( $exclude_tags as $i){ $exclude_tags_ids[] = get_term_by('slug',$i, 'post_tag'); } $args=array( 'tag__not_in' => $exclude_tags_ids, 'post_type' => 'post', 'post_status' => 'publish', 'numberposts'=>20, 'caller_get_posts'=> 1 ); $my_query = null; $my_query = new WP_Query($args); ....
Forum: Hacks
In reply to: Faking a pageLike Ross says, there are a lot of chart plugin in wp-plugin repository.
But if you build your by yourself, you can start to check
a good tutorial to make a sidebar widget
https://www.wpbeginner.com/wp-tutorials/how-to-create-a-custom-wordpress-widget/and how to make a shortcode in wp
https://codex.www.ads-software.com/Shortcode_APIhttps://codex.www.ads-software.com/Shortcode_API#Self-Closing
Forum: Hacks
In reply to: Innerhtml text replacementTry to use WP AJAX API and with jquery
in function.php of your theme add
add_action( 'admin_footer', 'my_action_javascript' ); // this need to print <script> in footer, add my_action_javascript function to wp_footer function my_action_javascript() { ?> <script type="text/javascript" > jQuery(document).ready(function($) { var data = { 'action': 'my_action', // name of php function 'userid': 1234 // var to send }; $.post(ajaxurl, data, function(response) { if(data){ $('#replaceMe').html(data); } }); }); </script> <?php } add_action( 'wp_ajax_my_action', 'my_action_callback' ); // for logged user add_action( 'wp_ajax_nopriv_my_action', 'my_action_callback' ); //for every user function my_action_callback() { $userid = intval( $_POST['userid'] ); // receive var form ajax call // put here your function $user = get_post($userid); if($user){ $html = '<h3>'.$user->post_title.'</h3>'; $html .= '<p>'.$user->post_content.'</p>'; } echo $html; wp_die(); // this is required to terminate immediately and return a proper response }
You can try full documentation here
Forum: Themes and Templates
In reply to: [Emphaino] Add category link on index page postsyou mean wp_list_categories?
https://codex.www.ads-software.com/Template_Tags/wp_list_categoriesForum: Themes and Templates
In reply to: Header / Footer Background Image Issuetry to change this in header.php
<meta name=”viewport” content=”width=device-width,initial-scale=1″>with something like
<meta name=”viewport” content=”width=1200,initial-scale=1″>Forum: Themes and Templates
In reply to: Reducing Space before Footeryou must edit style.css, and change height property of #footer
(https://www.canadianmacedonianplace.com/wp-content/themes/twentyten-childcmp/style.css)#footer{
height: 340px;Forum: Plugins
In reply to: Infinite Scroll Not Workingtry this for js
$('#content').infinitescroll({ navSelector : ".navigation", nextSelector : ".navigation .next a", itemSelector : "#content .post" , });
and this for pagination
<nav id="navigation"> <div class="past"><?php previous_posts_link('« Previous Entries') ?></div> <div class="next"><?php next_posts_link('Next Entries »','') ?></div> </nav>
Forum: Fixing WordPress
In reply to: help me order by custom field (float and str)this work for me ?? my custom field is with price but without €$r, symbols…
you can try to order with javascript/jquery(function( $ ) { jQuery.fn.orderBy = function(keySelector,inverse){ return this.sort(function(a,b){ a = keySelector.apply(a); b = keySelector.apply(b); return ( isNaN(a) || isNaN(b) ? a > b : +a > +b ) ? inverse ? -1 : 1 : inverse ? 1 : -1; }); };})( jQuery ); $(".preco").orderBy(function(){ return +$(this).text(); },true);
Forum: Fixing WordPress
In reply to: Older and newer posts links show up on single pagesin single page work only next post/previus post
code is<?php previous_post('« « %', '', 'yes'); ?> | <?php next_post('% » » ', '', 'yes'); ?>
put it in single.php
more info here
Forum: Fixing WordPress
In reply to: Posts Category Problem (need help)You can try to create new post type for your blog, (for example ‘portfolio’). Basically a new label appear in your backend, you can edit/manage it like a page or post, you can link it to category or custom taxonomy, the same in template hierarchy.
check here:
https://kovshenin.com/2010/custom-post-types-in-wordpress-3-0/
https://wp.tutsplus.com/tutorials/theme-development/innovative-uses-of-wordpress-post-types-and-taxonomies/here a post type generator
https://themergency.com/generators/wordpress-custom-post-types/?1Forum: Fixing WordPress
In reply to: help me order by custom field (float and str)sorry ?? try with this
$argsvs = array( 'post_type' => 'imovel-para-venda', 'meta_key' => 'wpcf-imovel-preco', 'posts_per_page' => 0, 'orderby' => 'meta_value', 'order' => 'ASC' );
https://codex.www.ads-software.com/Class_Reference/WP_Query#Order_.26_Orderby_Parameters
Forum: Fixing WordPress
In reply to: help me order by custom field (float and str)i dont understand what you want to do, but right way to call metaquery for custom order is
$argsvs = array( 'post_type' => 'imovel-para-venda', 'posts_per_page' => -1, 'meta_query' => array( 'key' => 'wpcf-imovel-preco', 'value' => 'meta_value_num', 'compare' => '>' ) );
Forum: Fixing WordPress
In reply to: single.php doesnt work with scheulde posti found a solution by installing this plugin
https://www.ads-software.com/extend/plugins/show-future-posts-on-single-post/Forum: Fixing WordPress
In reply to: Disable scheduled posti found solution to the problem,
integrate your first code, with query_status
and for show in single post i use this plugin
https://www.ads-software.com/extend/plugins/show-future-posts-on-single-post/