ditikos
Forum Replies Created
-
Forum: Plugins
In reply to: [Polylang] Not loading custom post type category templateHi, I am having the same problem.
I have a category.php and a category-news.php which I want to load specific layout for news (custom post type). In default language it loads ok, when I switch the language it goes to the default category.php file.
Is there a workaround for this?
Forum: Fixing WordPress
In reply to: How to using "pll_get_post" show the internal page correct language@huanhip
you did not mention that you wanted to show BOTH the languages. In that case you need the first parent and its translation to be shown, regardless of the language you are in to, right?Otherwise the query above works, as long as you have connected your translations.
If you want to show in BOTH spanish and english, knowing that 6 is the first language and 10 the second, then you do this:
$ids = array(6,10); $opts = array( 'post_type' => 'page', 'post_status' => 'publish', 'post_parent__in' => $ids, 'posts_per_page' => -1 );
the rest stays the same.
Forum: Fixing WordPress
In reply to: Users keep registering on my website as administratorsPerhaps you should post tha list of the plugins you have on your installation at first.
Forum: Fixing WordPress
In reply to: How to add per post background the right way?Hi, can you post a link to your site?
Forum: Fixing WordPress
In reply to: Adding ad code below X paragraphs?Here is a similar example. I was using twentysixteen as my main theme and needed something like that. You might want to change some stuff because you don’t mention your own theme.
Assuming that each paragraph is cut via a
then the code would be like that:function adify_paragraphs($content) { $tmp = $content; $tmp = explode('<br />',$content); $adcode = "<span style='color:red;'>hahaw</span>"; //replace with ad code here. if (count($tmp)>4): array_splice($tmp,4,0,$adcode); endif; if (count($tmp)>20): array_splice($tmp,20,0,$adcode); endif; $cc = implode("<br/>",$tmp); return $cc; } add_filter( 'the_content', 'adify_paragraphs');
If indeed you have paragraphs (<p>..</p>) then the starting code should be changed like this:
function adify_paragraphs($content) { $tmp = $content; $tmp = explode('</p>',$content); $adcode = "<p><span style='color:red;'>hahaw</span>"; if (count($tmp)>4): array_splice($tmp,4,0,$adcode); endif; if (count($tmp)>20): array_splice($tmp,20,0,$adcode); endif; $cc = implode("<p/>",$tmp); return $cc; } add_filter( 'the_content', 'adify_paragraphs');
Forum: Fixing WordPress
In reply to: Why page reload after click icon besides categoryProbably a leftover or a broken anchor code. In order to see that correctly and figure out what’s wrong you might want to share your live site url.
Forum: Hacks
In reply to: Nav Walker, why do you hate me? (I'm missing something here)Hi,
nav walkers are a tough subject, I learned much from this article. Perhaps it can help you too.
Forum: Fixing WordPress
In reply to: How to customise RSS feed on my wordpress siteHi,
try something like this:
function myfeed_request( $qv ) { if ( isset( $qv['feed'] ) && !isset( $qv['post_type'] ) ) { $qv['post_type'] = array( 'post', 'events', 'awards', 'media' ); } if ( isset( $qv['feed'] ) && isset( $_REQUEST['post_type'] ) && $_REQUEST['post_type']=="main") { $qv['post_type'] = array( 'post' ); } return $qv; } add_filter( 'request', 'myfeed_request' );
Using ?post_type=main you can get only your posts as before.
Forum: Fixing WordPress
In reply to: Seperate home page post width and single page width [twenty sixteen]Hey,
try this below
body:not(.search-results) article:not(.type-page) .entry-content
entry:body.home article:not(.type-page) .entry-content { float: right; width: 70%; } body.single article:not(.type-page) .entry-content { float: right; width: 90%; }
Forum: Fixing WordPress
In reply to: Fatal error when add a record to WordPress tableFirst of all try to see if the $wpdb->prefix points to correct prefix.
Secondly you could use a prepare statement, which is better to protect from SQL injectionsfunction setdb($email){ global $wpdb; $tablename = $wpdb->prefix.'nd_tempemails' $wpdb->query( $wpdb->prepare( " INSERT INTO $tablename ( 'email' ) VALUES ( %s ) ", $email ) ); }
Forum: Fixing WordPress
In reply to: Seperate home page post width and single page width [twenty sixteen]Try:
.home .post { width: 70%; } .single .post { width: 90%;}
.home refers to the homepage, .single to single.php and .page to page.php if you need change there.
Forum: Fixing WordPress
In reply to: How to using "pll_get_post" show the internal page correct languagePerhaps you could use the rest of the polylang functions like this:
<?php global $post; $post_parent = 6; $parent = pll_get_post($post_parent,pll_current_language()); $opts = array( 'post_type' => 'page', 'post_status' => 'publish', 'post_parent' => 6, 'lang' => pll_current_language() ); $pages = new WP_Query($opts); while ($pages->have_posts()): $pages->the_post(); // code from this point is like the loop ?> <?php endwhile; wp_reset_postdata();
Forum: Everything else WordPress
In reply to: Auto Reply When User RegistersYou could try this plugin: https://www.ads-software.com/plugins/bnfw/ it seems friendly enough.
Forum: Everything else WordPress
In reply to: Post Clients details on different websiteThis seems like a custom functionality that would be plugged in to the form to do the functionality since it seems the process is not standard.
You would require a developer to make this or seek something in gravity forms for example.
Forum: Everything else WordPress
In reply to: Coding inquiriesYou could track visitors via google analytics (or pikwik or any other analytics package there is) saving you most of the fuss of making a plugin or code something that in the long run won’t work properly.