Are you the publisher? Claim or contact us about this channel


Embed this content in your HTML

Search

Report adult content:

click to rate:

Account: (login)

More Channels


Channel Catalog


Channel Description:

WordPress › Support

older | 1 | .... | 403 | 404 | (Page 405) | 406 | 407 | .... | 413 | newer

    0 0

    Hi guys,

    Say I have 2 taxonomies (main-tax-1, sub-tax-2), I want to display a post in an archive if main-tax-1 displays the same term as sub-tax-2 and vice versa.

    I assume I'd have to add code in the functions file but where do I start?


    0 0

    I am installing schema into my site and I am getting a bit stuck with the datePublished property.

    I am trying to get :itemprop="datePublished" to show up whenever the get_the_date function runs, but all that happens is i seem to overide all the info that is in the get_the_date function.

    here is an example of the code i have installed in my functions.php:

    /* adds schema to post date */
    add_filter('get_the_date', 'schema_get_the_date');
        function schema_get_the_date($attr) {
        $attr['itemprop'] = 'datePublished';
        return $attr;
    }

    how can i get that itemprop to be able to appear next to the date the post was published so that it can register as schema?


    0 0

    Hello.
    I'm searching the whole day, is it possible to change an e-mail which is sent after user asks for password reset. I want to change the text of e-mail and modify it.

    I'm getting e-mail after reseting the password
    For subject
    "Your new password for [name of the site]",
    and text is
    Your new password is: password.

    Thanks.


    0 0

    On my site there is a google map with markers for all the properties. I need to place that map with markers on one of my pages, which contains an agent and all his/her properties. Both agents and properties are custom posts. Markers are made of properties addresses.

    So far I was able to put the map, but it shows the markers for all the properties available. I don't know how to target only these few properties that are assigned for particular agent.

    The code that checks if google map is needed looks like this: http://pastebin.com/hQXDengG

    I modified it by adding
    || is_singular( 'agent' )
    on line 26.

    When I tried to target specific agent with "is_single('agent_name'); it is doing the same thing, showing all the properties. The question is how to modify this code to target every agent separately. I guess I need some kind of if statement.


    0 0

    Hi,

    I have down code in a plugin, and I want the title to be internationalized for translation.
    I have been trying quite some versions in vain.. How do you do this?
    The closest thing I found when searching was this;
    'title' => __('Evenemang denna vecka', 'event-organiser-ngo'), but it does not work

    class PortalOneWeekCalendar extends WP_Widget{
      var $w_arg = array(
        'title'	          => 'Evenemang denna vecka',
        'showpastevents'	  => 1,
        'event_start_after'	  =>'last Monday',
        'event_start_before'  =>'next Sunday'
        );
    
      function __construct() {
        $widget_ops = array('classname' => 'PortalOneWeekCalendar', 'description' => __('Visar denna veckas evenemang.','event-organiser-ngo') );
        parent::__construct('PortalOneWeekCalendar', __('Portalkalender','event-organiser-ngo'), $widget_ops);
      }

    Edit, fixed the code so it's easier to read.


    0 0

    Hi,

    I'm trying to internationalize a template file for a custom post type with taxonomies.

    I'm using;
    the_terms( $post->ID, 'concert_scenes', '<div style="padding-bottom: 3px"><b>Spelas p&aring:</b> ', ', ', '</div>' );?>
    to echo out the taxomomy.

    But I fail to understand how to translate this. I guess I need to use placeholders and printf() but how do I do this?

    I've been at this for quite some time now, googling, reading the i18n part of "Pro WP plugin development" and trying to search here at WP, but I can't find a working solution... Anyone that has a clue?

    Regards /Joje


    0 0

    Semi-noob question...

    I had some script embedded in a text widget.

    I want to move this to an external .js file and enqueue it properly as I want it to play nice with the Minit plug-in which makes scripts load asynchronously.

    I managed to move it into an external file OK and I have followed everything I can find about registering and enqueuing the script in my child theme's functions.php

    I have:

    /**** Enqueue script used for resetting dropdowns on contact form ****/
    function adding_fc_scripts() {
    	wp_register_script('resetdropdowns', '/wp-content/themes/fc-zerif-lite-child/js/resetdropdowns.js', array('jquery'),'1.0', true);
    	wp_enqueue_script('resetdropdowns');
    }
    
    add_action( 'wp_enqueue_scripts', 'adding_fc_scripts' );

    In my functions.php. Do I now need something to call the script where I want it called (e.g. in the .php template)?

    At the moment nothing happens (and there are no debug or Chrome console errors).

    Thanks.


    0 0

    My site http://mywarehousehome.com/ was built using Wordpress and the 'Origin' theme from Elegant Themes.

    I've subsequently launched an e-shop and want to drive users who read the blog posts to click through to the e-shop: http://mywarehousehome.com/shop

    I've designed a 120px x 600px skyscraper ad and am looking for a way to insert it into the right hand margin of every blog post (the white space visible when viewing on a desktop). Here's a blog post example: http://mywarehousehome.com/feature-radiators-5-timeless-designs/

    I had thought this could be done in the post template?

    The skyscraper ad would need to be hyperlinked to http://mywarehousehome.com/shop and ideally it would float, so that it remains visible as readers scroll down through each blog post.

    As you can tell, I am still learning. So all advice would be really appreciated.

    Thank you.


    0 0

    Hi Im getting a lot of 404's error from a program i have set up on my website.
    this 404 errors are not because my site is broken, none of the pages being looked for are ones i have.

    im being hit with page names like, /wp-config.php.orig or /wp-config.php.bak or /wp-config.php~ or /th1s_1s_a_4o4.html

    im getting worried and fear im being hacked?
    I have the ip's here are a few of the main ones
    184.154.139.25
    157.55.39.12
    69.175.118.170
    195.154.199.125

    what can i do, is this a hack and what plugin shall i use to stop this please

    im using ipage as a server for my wordpress site

    Thanks in advance


    0 0

    I've got a custom post type (reviews) and several custom taxonomies pertaining to that type (authors etc etc). I've made a template file called archive-reviews.php, which I want to be used for all archives (including custom taxonomy archives) in the custom post type.
    Right now, however, it's only working for example.com/reviews - and it won't work for other custom post type archives (authors etc).
    Is there anyway I can do that? As far as I know I've used the correct naming procedure, but I might be wrong.


    0 0

    Firstly; I have searched high and low for a solution to the problem I am having (over the last 2-3 weeks), but nothing I have done has been able to get the pagination working for a post displaying a grid of posts. I would include more links in this post (including website in question) but I am limited to posting 2 urls.

    (The theme being used is Divi, by Elegant Themes. ..child theme is being used)

    So:
    I have created a CPT and am using Advanced Custom Fields (ACF) to enable a simple admin page for the user to enter details (for each new post). This creates the new post of the CPT.

    Posts that are created with this CPT are automatically listed on this page: 4wdaus.com/travel-blog

    When a post from the Travel Blog page is selected for viewing, it displays an introductory page [post] that displays a grid of all blog posts with the category that is relevant for that page (trip) - not the CPT. It is this page where I would like the pagination, and these are the pages where the problem is.

    The code for creating the CPT is this:

    ?php
    function major_trips_cpt() {
      $args = array(
        'labels' => array(
            'name'          => 'Major Trips',
            'singular_name' => 'Major Trip',
           'all_items'     => 'All Major Trips',
        ),
        'supports'      => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields' ),
        'menu_position' => 4,
        'show_ui'             => true,
        'show_in_menu'        => true,
        'show_in_admin_bar'   => true,
        'description'   => ( 'New Major Trip Entry'),
        'public'        => true,
        'has_archive'   => true,
        'menu_icon'     => get_stylesheet_directory_uri() . '/images/fwdaus-icon.png',
        'rewrite'        => array('slug' => '4wdaus-major_trips')
      );
      register_post_type( 'major_trip', $args );
    }
    add_action( 'init', 'major_trips_cpt' );
    ?>

    ..and for displaying the grid of posts in the custom single.php (in the child theme) is:

    <?php
       $args = array(
           'post_type' => 'post',
           'posts_per_page' => 6,
           'order' => 'desc',
           'orderby' => 'date',
           'tax_query' => array(
               array(
                   'taxonomy' => 'category',
                   'field'    => 'slug',
                   'terms'    => get_field('category_to_display'), // category from the Advanced Custom Field variable
               ),
           ),
       );
    
        if ( get_query_var('paged') ) {
            $args['paged'] = get_query_var('paged');
        } elseif ( get_query_var('page') ) {
            $args['paged'] = get_query_var('page');
        } else {
            $args['paged'] = 1;
        }
    
        $the_query = new WP_Query( $args );
    
       // Pagination fix
       $temp_query = $wp_query;
        $wp_query   = NULL;
        $wp_query   = $the_query;
      ?>
    
     <div id="fwd-blog-grid">
     <?php if ( $the_query->have_posts() ) : ?>
         <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
             <div class="fwd-grid-item">
                 <?php if ( has_post_thumbnail() ) {
                     the_post_thumbnail();
                 } ?>
                 <h2><a href='<?php the_permalink(); ?>'><?php the_title(); ?></a></h2>
                 <div class="entry-content">
                     <a href='<?php the_permalink(); ?>'><?php the_excerpt(); ?></a>
                 </div>
             </div>
         <?php endwhile; ?>
    
         <?php
             wp_reset_postdata();
    
             echo "<div style='clear: both;'>";
                //wp_pagenavi( array( 'query' => $the_query ) );
                echo "<div style='float: left;'>";
                    next_posts_link( '&laquo; Older Posts' );
                echo "</div>";
                echo "<div style='float: right;'>";
                        previous_posts_link( 'Newer Posts &raquo;' );
                    echo "</div>";
             echo "</div>";
    
             // Reset main query object
             $wp_query = NULL;
             $wp_query = $temp_query;
         ?>
    </div>

    This page (amongst many many others I have read) would appear the best resource I can find, but maybe there is something I haven't understood? How to fix pagination for custom loops?

    Maybe some useful info
    - the page displaying the post grid to be paginated is a Post as opposed to a page (with reference to WP terminology)
    - the grid of posts being displayed (where pagination is not working) are not of the CPT. They are displayed as per the relevant category - an ACF variable
    - when mouse pointer hovers over 'Older Posts' link, url is shown with '/page/2/' added, but when clicked, the first initial page is shown
    - if tested, the variable of 'max_num_pages' will return a number greater than 1, so there are numerous pages to display
    - I am not able to manually enter the URL with /page/2/ added, in the address bar. Initial page is displayed.
    - if I enter a fixed category for the post grid (as opposed to the ACF variable) it makes no difference, except for displaying a grid of posts of the same category on each page
    - if I enter a number for 'paged' in code. eg. '$args['paged'] = 3' the third page will actually be displayed
    -- with the previously mentioned test, the link for 'Newer Posts' is still not displayed. Only 'Older Posts' is displayed.

    I realise this is probably a reasonably long post and maybe there are still important details I have not mentioned, but here's hoping that someone might have some suggestions.

    Thanks


    0 0

    Hi, I have about sixty input fields to be collected with my CPT. For this purpose I'm using the meta boxes. I'd like know if there are data structures suitable to achieve this task. For example, BadgeOS does use of associative arrays of array for defining custom fields. So I'm also trying to define them in my code. Here some snippet codes:

    function custom_fields() {
    $prefix = 'var_';
    
    // First meta box
    $fields = array (
      array (
        'label' => 'Picture',
        'id' => $prefix . 'picture',
        'desc' => 'Description...',
        'type' => 'select',
        'options' => array ( 'Picture 1', 'Picture 2', 'Picture 3', )
       ),
      array (
         'label' => 'Something',
         ....
      ),
      ...
    );
    $cutsom_fields[] = array (
      'id' => 'first_meta_box',
      'title' => 'Title',
      'context' => 'side',
      'priority' => 'low',
      'page_slug' => 'mf_product',
      'fields' => $fields,
    };
    // Second meta box
    $fields = array ( ... );
    $custom_fields[] = array ( ... ),
    ...
    // And so forth
    ...
    return $custom_fields;
    }
    
    function create_mbox() {
     $cf = custom_fields();
     $cpt = array_column( $cf, 'page_slug' );
     foreach ( $cpt as $custom_post ) {
       foreach ( $cf as $field ) {
          add_meta_box( $field['id'],
          'print_mbox'',
          $custom_post,
          $field['context'],
          $field['priority'],
          $field['fields'] );
       }
     }
    }

    Is there a more efficient way than this?


    0 0

    Hi,
    I've the exact same problem as another fellow with the name NOZAHON. The widget area stretches over the whole length!
    The answer he got was by a member named:KROZERO. He wrote to add,
    .header-right-widget{
    width: 100px;
    float: right;
    }
    in the css file and to add/change the code in html to,
    <div class="header-right-widget"><?php dynamic_sidebar( 'header-widget' ); ?></div>
    I tried it but nothing. Of course i changed the part ('header-widget') to the real widgets name and tried al kinds of different things, but no results, HELP PLEASE!
    kind regards


    0 0

    hi
    i want in a site create one top-menu similar site
    http://w3.siemens.com/mcms/automation/en/Pages/automation-technology.aspx
    when click on "sensor system" subcategory "automation technology " show subcategory "sensor" in page sensor
    pleseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee help me!!!!!


    0 0

    I am trying to get my localize script to work however whenever I run the script I get the object is not defined.

    I am updating one of my plugins to ajax and using Tom McFarlin's Plugin Boiler Plate.

    Here is my php code:

    wp_localize_script('ajax-js', 'ajax_params', array(
    
    			'alert' => __('Hey! You have clicked the button!', 'my-plugin')
    
    		));

    here is my script:

    jQuery(document).ready(function($){
    
    	$('.someClass').click(function(){
    
    		alert(ajax_params.alert);
    
    	});
    
    });

    Yet when I click on the button it get the error that ajax_params is not defined.

    What am I missing.
    Thanks


    0 0

    Wordpress Community,

    I've finally made the transition from Joomla to Wordpress but could use some help. Thank you in advance for your help!

    I'm using WordPress 4.5.3 with the Woocommerce plugin. I would like a system generated username but not the one generated by taking the email address minus the domain name. Instead, I'd like a unique identifier that looks like this SK00000 and auto increments for each user (I know this is not super user-friendly but its a legacy requirement). Can somebody guide me on the best way to do this? It looks like I have to modify the modules specific to wordpress as that's what appears to be generating the username. Is that correct?

    -H


    0 0

    Hi,
    I've installed latest version of wordpress and tried to create custom post type with thumbnail support:

    protected function _applyCustomPostTypes() {
            add_action( 'init', array($this, 'customPostMedia') );
        }
    
        public function customPostMedia() {
            register_post_type( 'custom-media',
                array(
                    'labels' => array(
                        'name' => __( 'Media' ),
                        'singular_name' => __( 'Media' )
                    ),
                    'public' => true,
                    'has_archive' => true,
                    'rewrite' => array('slug' => 'custom-media'),
                    'supports' => array(
                        'title','editor','thumbnail'
                    )
    
                )
            );
        }

    No thumbnail box is shown in add/edit post page for this post type in admin.

    How can I add this support ?

    Best


    0 0

    I have a plugin I wrote in /wp/wp-content/plugins/survey-generator

    The main file is called survey-generator.php.

    In this file's header, I have included

    Text Domain: survey-generator
    Domain Path: /languages

    I've used the double-underscore function with strings and included the text domain. For example:
    defined('ABSPATH') or exit(__('This is a WordPress plugin.', 'survey-generator'));

    In the languages directory, I have generated survey-generator.pot with makepot.php and have used PoEdit to create survey-generator-it_IT.po and survey-generator-it_IT.mo files.

    When I change the language to Italian in the Wordpress admin panel, Wordpress itself changes to Italian, but the messages generated by my plugin still appear in English.

    In the header of the main file survey-generator.php, I have also used

    Text Domain: survey-generator
    Domain Path: /wp/wp-content/plugins/survey-generator/languages

    but it made no difference.

    I don't know what I'm missing. Can anyone suggest anything?


    0 0

    I am trying to add a section on my page (dev.ntv.ca) to float right across from the Heading. but whenever I edit the template theme it moves the sidebar but doesn't display the new content at all. What am I doing wrong?

    css:

    .TilesArea {
        position: absolute;
        right: 0;
        top: 0;
        display: block;
        height: 125px;
        width: 125px;
    }

    Template file:

    <div class="td-container">
            <div class="td-container-border">
                <?php
                switch ($loop_sidebar_position) {
                    default:
                        ?>
                        <div class="td-pb-row td-pagebuilder-sidebar-right">
                            <div class="td-pb-span8 td-main-content" role="main">
                                <div class="td-ss-main-content">
                                    <?php
                                    if (have_posts()) {
                                    while ( have_posts() ) : the_post();
                                    ?>
                                    <div class="td-page-header td-pb-padding-side">
                                        <?php echo td_page_generator::get_page_breadcrumbs(get_the_title()); ?>
                                        <h1 class="entry-title td-page-title">
                                            <span><?php the_title() ?></span>
                                        </h1>
                                    </div><div class="TilesArea">Tile Here Please</div>
                                    <div class="td-pb-padding-side td-page-content">
                                        <?php
                                        the_content();
                                        endwhile;//end loop
                                        }
                                        ?>
                                    </div>
                                </div>
                            </div>
                            <div class="td-pb-span4 td-main-sidebar" role="complementary">
                                <div class="td-ss-main-sidebar">
                                    <?php get_sidebar(); ?>
                                </div>
                            </div>
                        </div>
                        <?php
                        break;
    
                    case 'sidebar_left':
                        ?>

    0 0

    I would like to completely eliminate the loop via plugin. My thought is to set has_posts() = false but it does not seem to work.

    Alternatively, I guess I could stop the query entirely.

    ideas?


older | 1 | .... | 403 | 404 | (Page 405) | 406 | 407 | .... | 413 | newer