Forum Replies Created

Viewing 15 replies - 256 through 270 (of 281 total)
  • Thread Starter Cezar Ayran

    (@ayrancd)

    Well… this might not be the best solution but… I just created a new field and then added one option value like “Select vanue” and populate the rest with my jQuery code and it worked… I don’t know why lol Tks!

    Thread Starter Cezar Ayran

    (@ayrancd)

    With custom taxonomy I am able to show up the correct category… I think I missed something because it doesn’t make sense having same categories for all post_types

    //SLA page
    function add_sla_page(){
        register_post_type('sla_pages',
          array(
               'labels' => array('name' => __('SLA Pages'), 'singular_name' => __('SLA Pages')),
               'public' => true,
               'has_archive' => true,
               'taxonomies' => array('sla_pages_tax'),
               'supports' => array('title', 'thumbnail'), //excerpt, custom-fields, comments, revisions, page-attributes
               'menu_icon' => 'data:image/svg+xml;base64,'.base64_encode('<svg version="1.1" id="Layer_1" xmlns="https://www.w3.org/2000/svg" xmlns:xlink="https://www.w3.org/1999/xlink" x="0px" y="0px" width="62.3px" height="75px" viewBox="0 0 62.3 75" xml:space="preserve"><path fill="#FCFCFC" d="M34.4,35.4c-0.1,0.1-0.1,0.3-0.1,0.5v36.2c0,0.5-0.5,0.9-1,0.7l-13.5-5.1V46.9c0-0.5-0.3-0.9-0.7-1l-12.3-4H6.7
      H6.6c-0.1,0-0.1,0-0.2,0H6.3c-0.1,0-0.2,0-0.3,0.1l0,0l0,0c-0.1,0-0.1,0.1-0.2,0.1l0,0c0,0,0,0-0.1,0.1l-0.1,0.1c0,0,0,0.1-0.1,0.1
      c0,0.1-0.1,0.1-0.1,0.2v0.1c0,0.1,0,0.2,0,0.3v19.4l-4.9-1.8C0.2,60.5,0,60.2,0,59.9V27.1l10.6-16.7l5.6-1.1
      c0.6-0.1,1.2,0.2,1.5,0.7l2.4,4.2c0.3,0.5,0.8,0.7,1.3,0.5l8.5-3c0.6-0.2,1.2,0,1.6,0.4l3.7,4.4c0.2,0.3,0.5,0.4,0.8,0.4
      c0.2,0,0.4-0.1,0.6-0.2l10.2-7.1L34.4,35.4z"/><path fill="#FCFCFC" d="M17.7,66.9l-3.4-1.2v-16c0-0.3-0.1-0.6-0.3-0.8l-3.6-3.5l7.3,2.3C17.7,47.7,17.7,66.9,17.7,66.9z"/><polygon fill="#FCFCFC" points="12.1,64.9 12.1,67.2 12.1,67.9 10.9,66.7 10.9,66.7 7.5,63.4 7.5,63.1 7.5,45.6 12.1,50.1 "/><path fill="#FCFCFC" d="M61.2,63.1L50.7,58V35.9c0-0.6-0.5-1.1-1.1-1.1s-1.1,0.5-1.1,1.1v22.4l-12,13.5V36.1l12.4-25.9
      c0.3-0.6,1.2-0.6,1.5,0l10.8,20.9C61.2,31.1,61.2,63.1,61.2,63.1z"/><path fill="#FCFCFC" d="M15,2.9L46.7,7l-10.5,7.4l-4.2-5c-0.3-0.3-0.8-0.5-1.2-0.3l-9.3,3.3l-2.8-5C18.5,7,18,6.8,17.5,6.9L8.2,8.7
      L15,2.9z"/></svg>')
          )
        );
    }
    add_action('init', 'add_sla_page');
    
    function custom_taxonmy(){ // FILE HAS TO BE taxonomy-category_tax.php
    
      $labels = array(
        'name'              => _x( 'Categories', 'taxonomy general name' ),
        'singular_name'     => _x( 'Category', 'taxonomy singular name' ),
        'search_items'      => __( 'Search Category' ),
        'all_items'         => __( 'All Categories' ),
        'parent_item'       => __( 'Parent Category' ),
        'parent_item_colon' => __( 'Parent Category:' ),
        'edit_item'         => __( 'Edit Category' ),
        'update_item'       => __( 'Update Category' ),
        'add_new_item'      => __( 'Add New Category' ),
        'new_item_name'     => __( 'New Category Name' ),
        'menu_name'         => __( 'Category' ),
    );
    
        $args = array(
            'labels'            => $labels,
            'public'            =>  true,
            'hierarchical'      =>  true,
            //'show_ui'           => true,
            'show_admin_column' => true,
            'show_in_nav_menus' =>  true,
            'has_archive'       =>  true,
            'rewrite'           =>  array('slug' => 'slaslider_cat', 'with_front' => false),
        );
        register_taxonomy('sla_pages_tax', 'sla_pages', $args);
    }
    add_action( 'init', 'custom_taxonmy'); 
    Thread Starter Cezar Ayran

    (@ayrancd)

    I didn’t find a solution using WP functions so I had to use a regular select using the code below:

    URL = state/florida/georgia….

    <?php
    	$tax = get_categories(array('taxonomy' => 'category_lab', 'posts_per_page' => 1,  'hide_empty' => false, 'slug' => $_GET["url"], 'orderby' => 'name', 'order'   => 'ASC'));
    	if(count($tax) == 0){
    		$stateN = "Try again";
    	}
    	foreach($tax as $cat) {
    		$stateN = $cat->name;
    	}
    ?>
    <div class="col12 title">
    	<?=$stateN?>
    </div>
    <div class="col12">
    	<?
    	$argsP = array(
        'post_type' => 'lab',
        'tax_query' => array(
            array(
              'taxonomy' => 'category_lab',
              'field' => 'slug',
              'terms' => $_GET["url"], 
              'include_children' => false
            )
          ), 'hide_empty' => false, 'orderby' => 'post_title', 'order'   => 'ASC'
    	);
    	$postsPages = get_posts($argsP);
    	if(count($postsPages) == 0){
    		echo "No results found :(";
    	}
    	foreach($postsPages as $post): ?>
    	<b><?=$post->post_title; ?></b><br>
    	<?
    		$results = $wpdb->get_results("SELECT wp_posts.ID, wp_posts.post_title FROM <code>wp_postmeta</code> inner join wp_posts on wp_postmeta.post_id = wp_posts.ID where wp_postmeta.meta_key = '_custom_post_type_onomies_relationship' and wp_postmeta.meta_value = ".$post->ID." and wp_posts.post_type = 'careers' and wp_posts.post_status = 'publish' order by wp_posts.post_title ");
    		if(count($results) == 0){
    			echo "No results found";
    		}
    		foreach($results as $career){ ?>
    	<a href="<?php the_field("pdf", $career->ID)?>" class="linkCareer"><?=$career->post_title?></a>
    	<? } ?>
    	<br><br>
    	<? endforeach; ?>
    </div>
    
    Thread Starter Cezar Ayran

    (@ayrancd)

    I found a plugin that does exactly what I need https://www.ads-software.com/plugins/cpt-onomies/

    Thread Starter Cezar Ayran

    (@ayrancd)

    Hi bro,

    Thank you for replying to me. I just removed the flush function.

    I’ve seen a plugin that uses its own table… and it works like:

    Gallery
    admin.php?page=then-and-now-galleries

    Algums inside of Gallery
    admin.php?page=then-and-now-galleries&action=edit&gallery=2

    I mean I don’t wanna use custom tables I wanna use whatever WP provides… if it cannot be using register_post_type is there any easy way to do it? Tks!

    Thread Starter Cezar Ayran

    (@ayrancd)

    State (taxonomy)
    -LAB (post type)
    –-Pathologists (post type) [how can I add LAB as a category/taxonomy of Pathologists?]
    –-Careers (post type) [how can I add LAB as a category/taxonomy of Careers?]

    Thread Starter Cezar Ayran

    (@ayrancd)

    State (taxonomy)
    -LAB (post type)
    –Pathologists [how can I add pathologists to a LAB?]

    • This reply was modified 5 years, 8 months ago by Cezar Ayran. Reason: Fixing
    Thread Starter Cezar Ayran

    (@ayrancd)

    Solved!

    Thread Starter Cezar Ayran

    (@ayrancd)

    I found the solution. Field name was wrong “post_name” it should be “name”. Code below is working properly. Sad that WP changed its field :/

    $argsP = array(
        'post_type' => 'sla_slider',
    	'tax_query' => array(
            array(
              'taxonomy' => 'category_tax',
              'field' => 'id',
              'terms' => 35, //pages
              'include_children' => false
            )
          ),
    		'name' => $url,
          	'posts_per_page' => 1,
            'orderby' => 'date',
            'order' => 'DESC'
            );
    $postsPages = get_posts($argsP);
    Thread Starter Cezar Ayran

    (@ayrancd)

    I got a solution. I just need to create an archive-capabilities.php ??

    Tks bro!

    • This reply was modified 5 years, 8 months ago by Cezar Ayran.
    Thread Starter Cezar Ayran

    (@ayrancd)

    After creating it using that plugin I think I understood what I should have changed…

    this part:

    register_post_type( 'Capabilities', $args );

    To

    register_post_type( 'capabilities-item', $args );

    And then I can change that URL and use whatever I want however.. it’s still not what I want lol

    That page uses archive.php file do you know how I can change it? Items can still be open like /capabilities/strategy/ but this page /capabilities/ I’d like to change it using my current custom page.

    • This reply was modified 5 years, 8 months ago by Cezar Ayran.
    Thread Starter Cezar Ayran

    (@ayrancd)

    HI bro. I don’t want to use a plugin, I got this code from the past developer, I never used this before so I just wanna fix it and change its URL.

    Thread Starter Cezar Ayran

    (@ayrancd)

    Hi Joy,

    I just added the code below:

     $args = array(
        'label'                 => __( 'Capabilities', 'text_domain' ),
        'description'           => __( 'Capabilities', 'text_domain' ),
        'labels'                => $labels,
        'supports'              => array( 'title', 'editor','thumbnail' ),
        'taxonomies'            => array( 'category', 'post_tag' ),
        'hierarchical'          => false,
        'public'                => true,
        'show_ui'               => true,
        'show_in_menu'          => true,
        'menu_position'         => 5,
        'show_in_admin_bar'     => true,
        'show_in_nav_menus'     => true,
        'can_export'            => true,
        'has_archive'           => true,
        'exclude_from_search'   => false,
        'publicly_queryable'    => true,
        'capability_type'       => 'page',
        'rewrite' => array('slug' => 'capabilities-item')
      );
      register_post_type( 'Capabilities', $args );

    And now when opening an item like /capabilities-item/branding/ it redirects me to 404 page and also /capabilities/ is still there.. I can’t use it as a regular page like I want. Any idea of what is missing? Tk u!

    • This reply was modified 5 years, 8 months ago by Cezar Ayran.
    Thread Starter Cezar Ayran

    (@ayrancd)

    Hi Andy,

    I don’t understand what you mean “border/transparent background for one category and a transparent border/background for a second category.”

    But is it possible for you to custom it? We can get a quote to make these changes!

    Thread Starter Cezar Ayran

    (@ayrancd)

    Hi Danny,

    Thank you for reply to me. No I’m not using any extra plugin for that form.

    I just did another test and I got “Thank you, your sign-up request was successful! Please check your email inbox to confirm.”

    This is a new issue lol because the option Use double opt-in? is NO so users shouldn’t be asked to confirm.. I also see this test in Mailchimp even with this request lol

Viewing 15 replies - 256 through 270 (of 281 total)